DefinitelyTyped/types/ember-mocha/index.d.ts
James C. Davis 687d92d01f
Ensure all members of the typed-ember team are authors on ember* type defs (#43429)
* chore: add @jamescdavis and @dfreeman to ember

* chore: add @jamescdavis and @dfreeman to ember-data

* chore: add @dfreeman, @chriskrycho, @jamescdavis to ember-feature-flags

* chore: add @dfreeman, @chriskrycho, @jamescdavis to ember-mocha

* chore: add @dfreeman, @chriskrycho, @jamescdavis to ember-modal-dialog

* chore: add @chriskrycho and @jamescdavis to ember-qunit

* chore: add @chriskrycho and @jamescdavis to ember-resolver

* chore: add @dfreeman, @chriskrycho, @jamescdavis to ember-test-helpers

* chore: add @dfreeman, @jamescdavis, @mike-north to ember-testing-helpers

* chore: update github url for @chriskrycho

* chore: add @chriskrycho, @dfreeman, @jamescdavis to ember__application

* chore: add @chriskrycho, @dfreeman, @jamescdavis to ember__array

* chore: add @chriskrycho, @dfreeman, @jamescdavis to ember__component

* chore: add @chriskrycho, @dfreeman, @jamescdavis to ember__controller

* chore: add @chriskrycho, @dfreeman, @jamescdavis to ember__debug

* chore: add @chriskrycho, @dfreeman, @jamescdavis to ember__engine

* chore: add @chriskrycho, @dfreeman, @jamescdavis to ember__error

* chore: add @chriskrycho, @dfreeman, @jamescdavis to ember__object

* chore: add @mike-north, @dfreeman, @jamescdavis to ember__ordered-set

* chore: add @chriskrycho, @dfreeman, @jamescdavis to ember__polyfills

* chore: add @chriskrycho, @dfreeman, @jamescdavis to ember__runloop

* chore: add @chriskrycho, @dfreeman, @jamescdavis to ember__service

* chore: add @chriskrycho, @dfreeman, @jamescdavis to ember__string

* chore: add @chriskrycho, @dfreeman, @jamescdavis to ember__template

* chore: add @chriskrycho to ember__test-helpers

* chore: add @chriskrycho, @dfreeman, @jamescdavis to ember__test

* chore: add @chriskrycho, @dfreeman, @jamescdavis to ember__utils
2020-03-28 11:50:24 -07:00

84 lines
3.0 KiB
TypeScript

// Type definitions for ember-mocha 0.14
// Project: https://github.com/emberjs/ember-mocha#readme
// Definitions by: Derek Wickern <https://github.com/dwickern>
// Simon Ihmig <https://github.com/simonihmig>
// Mike North <https://github.com/mike-north>
// Dan Freeman <https://github.com/dfreeman>
// Chris Krycho <https://github.com/chriskrycho>
// James C. Davis <https://github.com/jamescdavis>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
import { TestContext, ModuleCallbacks } from "ember-test-helpers";
import Ember from 'ember';
import { it as mochaIt, ISuiteCallbackContext } from 'mocha';
// these globals are re-exported as named exports by ember-mocha
type mochaBefore = typeof before;
type mochaAfter = typeof after;
type mochaBeforeEach = typeof beforeEach;
type mochaAfterEach = typeof afterEach;
type mochaSetup = typeof setup;
type mochaTeardown = typeof teardown;
type mochaSuiteSetup = typeof suiteSetup;
type mochaSuiteTeardown = typeof suiteTeardown;
declare module 'ember-mocha' {
interface ContextDefinitionFunction {
(name: string, description: string, callbacks: ModuleCallbacks, tests: (this: ISuiteCallbackContext) => void): void;
(name: string, description: string, tests: (this: ISuiteCallbackContext) => void): void;
(name: string, callbacks: ModuleCallbacks, tests: (this: ISuiteCallbackContext) => void): void;
(name: string, tests: (this: ISuiteCallbackContext) => void): void;
}
interface ContextDefinition extends ContextDefinitionFunction {
only: ContextDefinitionFunction;
skip: ContextDefinitionFunction;
}
interface SetupTest {
(name?: string, callbacks?: ModuleCallbacks): void;
(callbacks: ModuleCallbacks): void;
}
interface TestHooks {
beforeEach: mochaBeforeEach;
afterEach: mochaAfterEach;
}
interface SetupOptions {
resolver: Ember.Resolver;
}
type NewSetupTest = (options?: SetupOptions) => TestHooks;
/** @deprecated Use setupTest instead */
export const describeModule: ContextDefinition;
/** @deprecated Use setupComponentTest instead */
export const describeComponent: ContextDefinition;
/** @deprecated Use setupModelTest instead */
export const describeModel: ContextDefinition;
export const setupTest: NewSetupTest & SetupTest;
export const setupAcceptanceTest: SetupTest;
export const setupComponentTest: SetupTest;
export const setupModelTest: SetupTest;
export const setupRenderingTest: NewSetupTest;
export const setupApplicationTest: NewSetupTest;
export const it: typeof mochaIt;
/**
* Sets a Resolver globally which will be used to look up objects from each test's container.
*/
export function setResolver(resolver: Ember.Resolver): void;
}
declare module 'mocha' {
// augment test callback context
interface Context extends TestContext {}
}