diff --git a/types/ember-qunit/v3/ember-qunit-tests.ts b/types/ember-qunit/v3/ember-qunit-tests.ts
index 42768a42ca..6ddb4e5454 100644
--- a/types/ember-qunit/v3/ember-qunit-tests.ts
+++ b/types/ember-qunit/v3/ember-qunit-tests.ts
@@ -133,7 +133,7 @@ module('x-foo', function(hooks) {
setupRenderingTest(hooks);
});
-// http://rwjblue.com/2017/10/23/ember-qunit-simplication/#setuprenderingtest
+// http://rwjblue.com/2017/10/23/ember-qunit-simplication/#setuptest
module('foo service', function(hooks) {
setupTest(hooks);
});
diff --git a/types/ember-test-helpers/ember-test-helpers-tests.ts b/types/ember-test-helpers/ember-test-helpers-tests.ts
index f21d554cfa..705d0c76b1 100644
--- a/types/ember-test-helpers/ember-test-helpers-tests.ts
+++ b/types/ember-test-helpers/ember-test-helpers-tests.ts
@@ -1,8 +1,10 @@
///
-import { ModuleCallbacks, TestModule } from "ember-test-helpers";
+import { ModuleCallbacks, TestContext, TestModule } from "ember-test-helpers";
import wait from 'ember-test-helpers/wait';
import hasEmberVersion from 'ember-test-helpers/has-ember-version';
+import hbs from 'htmlbars-inline-precompile';
+
function moduleFor(name: string, description: string, callbacks: ModuleCallbacks) {
const module = new TestModule(name, description, callbacks);
@@ -23,3 +25,29 @@ async function testWait() {
if (hasEmberVersion(2, 10)) {
// ...
}
+
+// https://github.com/emberjs/ember-test-helpers/blob/f07e86914f2a3823c4cb6787307f9ba2bf447e68/tests/unit/setup-context-test.js
+QUnit.test('it sets up this.owner', function(this: TestContext, assert: Assert) {
+ const { owner } = this;
+ assert.ok(owner, 'owner was setup');
+ assert.equal(typeof owner.lookup, 'function', 'has expected lookup interface');
+
+ if (hasEmberVersion(2, 12)) {
+ assert.equal(typeof owner.factoryFor, 'function', 'has expected factory interface');
+ }
+});
+
+QUnit.test('can pauseTest to be resumed "later"', async function(this: TestContext, assert: Assert) {
+ const promise = this.pauseTest();
+
+ this.resumeTest();
+
+ await promise;
+});
+
+// https://github.com/emberjs/ember-test-helpers/blob/fb4c8d4cd36b54728ce180227f865b1fa0162632/tests/unit/setup-rendering-context-test.js
+QUnit.test('render exposes an `.element` property', async function(this: TestContext, assert: Assert) {
+ await this.render(hbs`
Hello!
`);
+
+ assert.equal(this.element.textContent, 'Hello!');
+});
diff --git a/types/ember-test-helpers/index.d.ts b/types/ember-test-helpers/index.d.ts
index 26591d7d23..f098c49a84 100644
--- a/types/ember-test-helpers/index.d.ts
+++ b/types/ember-test-helpers/index.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for ember-test-helpers 0.6
+// Type definitions for ember-test-helpers 0.7
// Project: https://github.com/emberjs/ember-test-helpers#readme
// Definitions by: Derek Wickern
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -34,7 +34,7 @@ declare module 'ember-test-helpers' {
send(actionName: string): void;
$: JQueryStatic;
subject(options?: {}): any;
- render(template?: string | string[] | TemplateFactory): void;
+ render(template?: string | string[] | TemplateFactory): Promise;
clearRender(): void;
registry: Ember.Registry;
container: Ember.Container;
@@ -47,6 +47,12 @@ declare module 'ember-test-helpers' {
controller(name: string, options?: { as: string }): any;
service(name: string, options?: { as: string }): any;
};
+ owner: Ember.ApplicationInstance & {
+ factoryFor(fullName: string, options?: {}): any;
+ };
+ pauseTest(): Promise;
+ resumeTest(): void;
+ element: Element;
}
class TestModule {