diff --git a/types/ember-qunit/tsconfig.json b/types/ember-qunit/tsconfig.json
index 3b9170403c..7b184205af 100644
--- a/types/ember-qunit/tsconfig.json
+++ b/types/ember-qunit/tsconfig.json
@@ -18,6 +18,8 @@
"@ember/engine/*": ["ember__engine/*"],
"@ember/application": ["ember__application"],
"@ember/application/*": ["ember__application/*"],
+ "@ember/test": ["ember__test"],
+ "@ember/test/*": ["ember__test/*"],
"@ember/object": ["ember__object"],
"@ember/object/*": ["ember__object/*"]
},
diff --git a/types/ember/index.d.ts b/types/ember/index.d.ts
index 1a13bc5a68..d07b51937f 100755
--- a/types/ember/index.d.ts
+++ b/types/ember/index.d.ts
@@ -25,6 +25,7 @@
///
///
///
+///
declare module 'ember' {
import {
@@ -69,6 +70,7 @@ declare module 'ember' {
import * as EmberApplicationNs from '@ember/application';
import * as EmberApplicationInstanceNs from '@ember/application/instance';
import * as EmberApplicationDeprecateNs from '@ember/application/deprecations';
+ import * as EmberTestNs from '@ember/test';
// tslint:disable-next-line:no-duplicate-imports
import * as EmberControllerNs from '@ember/controller';
// tslint:disable-next-line:no-duplicate-imports
@@ -105,6 +107,8 @@ declare module 'ember' {
import EmberEventDispatcher from '@ember/application/-private/event-dispatcher';
import EmberRegistry from '@ember/application/-private/registry';
import EmberResolver from '@ember/application/resolver';
+ // @ember/test
+ import EmberTestAdapter from '@ember/test/adapter';
type Mix = B & Pick>;
type Mix3 = Mix, C>;
@@ -410,27 +414,12 @@ declare module 'ember' {
* This is a container for an assortment of testing related functionality
*/
namespace Test {
- /**
- * `registerHelper` is used to register a test helper that will be injected
- * when `App.injectTestHelpers` is called.
- */
- function registerHelper(
- name: string,
- helperMethod: (app: Application, ...args: any[]) => any,
- options?: object
- ): any;
- /**
- * `registerAsyncHelper` is used to register an async test helper that will be injected
- * when `App.injectTestHelpers` is called.
- */
- function registerAsyncHelper(
- name: string,
- helperMethod: (app: Application, ...args: any[]) => any
- ): void;
- /**
- * Remove a previously added helper method.
- */
- function unregisterHelper(name: string): void;
+ class Adapter extends EmberTestAdapter {}
+ const registerHelper: typeof EmberTestNs.registerHelper;
+ const unregisterHelper: typeof EmberTestNs.unregisterHelper;
+ const registerWaiter: typeof EmberTestNs.registerWaiter;
+ const unregisterWaiter: typeof EmberTestNs.unregisterWaiter;
+ const registerAsyncHelper: typeof EmberTestNs.registerAsyncHelper;
/**
* Used to register callbacks to be fired whenever `App.injectTestHelpers`
* is called.
@@ -454,28 +443,7 @@ declare module 'ember' {
* an instance of `Ember.Test.Promise`
*/
function resolve(value?: T | PromiseLike, label?: string): Ember.Test.Promise;
- /**
- * This allows ember-testing to play nicely with other asynchronous
- * events, such as an application that is waiting for a CSS3
- * transition or an IndexDB transaction. The waiter runs periodically
- * after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed,
- * until the returning result is truthy. After the waiters finish, the next async helper
- * is executed and the process repeats.
- */
- function registerWaiter(callback: () => boolean): any;
- function registerWaiter(
- context: Context,
- callback: (this: Context) => boolean
- ): any;
- /**
- * `unregisterWaiter` is used to unregister a callback that was
- * registered with `registerWaiter`.
- */
- function unregisterWaiter(callback: () => boolean): any;
- function unregisterWaiter(
- context: Context,
- callback: (this: Context) => boolean
- ): any;
+
/**
* Iterates through each registered test waiter, and invokes
* its callback. If any waiter returns false, this method will return
@@ -486,32 +454,13 @@ declare module 'ember' {
* Used to allow ember-testing to communicate with a specific testing
* framework.
*/
- const adapter: Adapter;
- /**
- * The primary purpose of this class is to create hooks that can be implemented
- * by an adapter for various test frameworks.
- */
- class Adapter {
- /**
- * This callback will be called whenever an async operation is about to start.
- */
- asyncStart(): any;
- /**
- * This callback will be called whenever an async operation has completed.
- */
- asyncEnd(): any;
- /**
- * Override this method with your testing framework's false assertion.
- * This function is called whenever an exception occurs causing the testing
- * promise to fail.
- */
- exception(error: string): any;
- }
+ const adapter: EmberTestAdapter;
+
/**
* This class implements the methods defined by Ember.Test.Adapter for the
* QUnit testing framework.
*/
- class QUnitAdapter extends Adapter {}
+ class QUnitAdapter extends EmberTestAdapter {}
class Promise extends Rsvp.Promise {
constructor(
executor: (
@@ -1030,20 +979,6 @@ declare module '@ember/service' {
interface Registry {}
}
-declare module '@ember/test' {
- import Ember from 'ember';
- export const registerAsyncHelper: typeof Ember.Test.registerAsyncHelper;
- export const registerHelper: typeof Ember.Test.registerHelper;
- export const registerWaiter: typeof Ember.Test.registerWaiter;
- export const unregisterHelper: typeof Ember.Test.unregisterHelper;
- export const unregisterWaiter: typeof Ember.Test.unregisterWaiter;
-}
-
-declare module '@ember/test/adapter' {
- import Ember from 'ember';
- export default class TestAdapter extends Ember.Test.Adapter { }
-}
-
declare module 'htmlbars-inline-precompile' {
interface TemplateFactory {
__htmlbars_inline_precompile_template_factory: any;
diff --git a/types/ember/tsconfig.json b/types/ember/tsconfig.json
index dc4e29326d..aa16c98843 100755
--- a/types/ember/tsconfig.json
+++ b/types/ember/tsconfig.json
@@ -26,6 +26,8 @@
"@ember/debug/*": ["ember__debug/*"],
"@ember/routing": ["ember__routing"],
"@ember/routing/*": ["ember__routing/*"],
+ "@ember/test": ["ember__test"],
+ "@ember/test/*": ["ember__test/*"],
"@ember/object": ["ember__object"],
"@ember/object/*": ["ember__object/*"],
"@ember/component": ["ember__component"],
diff --git a/types/ember__test/adapter.d.ts b/types/ember__test/adapter.d.ts
index 5f312cf381..0ecdf064a8 100644
--- a/types/ember__test/adapter.d.ts
+++ b/types/ember__test/adapter.d.ts
@@ -1,2 +1,20 @@
-import Ember from 'ember';
-export default class TestAdapter extends Ember.Test.Adapter { }
+/**
+ * The primary purpose of this class is to create hooks that can be implemented
+ * by an adapter for various test frameworks.
+ */
+export default class Adapter {
+ /**
+ * This callback will be called whenever an async operation is about to start.
+ */
+ asyncStart(): any;
+ /**
+ * This callback will be called whenever an async operation has completed.
+ */
+ asyncEnd(): any;
+ /**
+ * Override this method with your testing framework's false assertion.
+ * This function is called whenever an exception occurs causing the testing
+ * promise to fail.
+ */
+ exception(error: string): any;
+}
diff --git a/types/ember__test/index.d.ts b/types/ember__test/index.d.ts
index 94bc312566..b63f2d983e 100644
--- a/types/ember__test/index.d.ts
+++ b/types/ember__test/index.d.ts
@@ -4,9 +4,50 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
-import Ember from 'ember';
-export const registerAsyncHelper: typeof Ember.Test.registerAsyncHelper;
-export const registerHelper: typeof Ember.Test.registerHelper;
-export const registerWaiter: typeof Ember.Test.registerWaiter;
-export const unregisterHelper: typeof Ember.Test.unregisterHelper;
-export const unregisterWaiter: typeof Ember.Test.unregisterWaiter;
+import Application from '@ember/application';
+
+/**
+ * `registerHelper` is used to register a test helper that will be injected
+ * when `App.injectTestHelpers` is called.
+ */
+export function registerHelper(
+ name: string,
+ helperMethod: (app: Application, ...args: any[]) => any,
+ options?: object
+): any;
+/**
+ * `registerAsyncHelper` is used to register an async test helper that will be injected
+ * when `App.injectTestHelpers` is called.
+ */
+export function registerAsyncHelper(
+ name: string,
+ helperMethod: (app: Application, ...args: any[]) => any
+): void;
+
+/**
+ * Remove a previously added helper method.
+ */
+export function unregisterHelper(name: string): void;
+
+/**
+ * This allows ember-testing to play nicely with other asynchronous
+ * events, such as an application that is waiting for a CSS3
+ * transition or an IndexDB transaction. The waiter runs periodically
+ * after each async helper (i.e. `click`, `andThen`, `visit`, etc) has executed,
+ * until the returning result is truthy. After the waiters finish, the next async helper
+ * is executed and the process repeats.
+ */
+export function registerWaiter(callback: () => boolean): any;
+export function registerWaiter(
+ context: Context,
+ callback: (this: Context) => boolean
+): any;
+/**
+ * `unregisterWaiter` is used to unregister a callback that was
+ * registered with `registerWaiter`.
+ */
+export function unregisterWaiter(callback: () => boolean): any;
+export function unregisterWaiter(
+ context: Context,
+ callback: (this: Context) => boolean
+): any;