From 54b3965d34e7bdfb63b130fe1fe20bf26837b5bb Mon Sep 17 00:00:00 2001 From: Albert Yu Date: Fri, 23 Mar 2018 21:20:46 +0800 Subject: [PATCH 1/3] [@types/ember-qunit] add missing definition for `setupApplicationTest` --- types/ember-qunit/index.d.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/types/ember-qunit/index.d.ts b/types/ember-qunit/index.d.ts index a669b977e1..ea129ec3ec 100644 --- a/types/ember-qunit/index.d.ts +++ b/types/ember-qunit/index.d.ts @@ -44,6 +44,20 @@ declare module 'ember-qunit' { */ export function setResolver(resolver: Ember.Resolver): void; + /** + * Sets up acceptance tests. + * + * The `setupApplicationTest` function is used for all acceptance tests. It + * is invoked in the callback scope of a QUnit module (aka "nested module"). + * + * Once invoked, all subsequent hooks.beforeEach and test invocations will + * have access to the following: + * * `this.owner` - the owner object that been set on the test context. + * * `this.pauseTest` and `this.resumeTest` - allow easy pausing/resuming of tests. + * * `this.element` which returns the DOM element representing the application's root element. + */ + export function setupApplicationTest(hooks: NestedHooks): void; + /** * Sets up tests that need to render snippets of templates. * @@ -80,7 +94,7 @@ declare module 'ember-qunit' { */ export function setupTest(hooks: NestedHooks): void; - export class QUnitAdapter extends Ember.Test.Adapter {} + export class QUnitAdapter extends Ember.Test.Adapter { } export { module, test, skip, only, todo } from 'qunit'; } From 9526aa700f36ebea5c10c592e16506ff72b63061 Mon Sep 17 00:00:00 2001 From: Albert Yu Date: Fri, 23 Mar 2018 21:21:37 +0800 Subject: [PATCH 2/3] [@types/ember-qunit] improve `skip` definition to align with others --- types/ember-qunit/index.d.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/ember-qunit/index.d.ts b/types/ember-qunit/index.d.ts index ea129ec3ec..ad12f43ffc 100644 --- a/types/ember-qunit/index.d.ts +++ b/types/ember-qunit/index.d.ts @@ -161,9 +161,10 @@ declare module 'qunit' { * ignoring the callback argument and the respective global and module's * hooks. * - * @param Title of unit being tested + * @param name Title of unit being tested + * @param callback Function to close over assertions */ - export const skip: typeof QUnit.skip; + export function skip(name: string, callback: (this: TestContext, assert: Assert) => void): void; export default QUnit; } From e4edb35bf5f59e24129021c27ea6a2347e582ef8 Mon Sep 17 00:00:00 2001 From: Albert Yu Date: Fri, 23 Mar 2018 21:39:33 +0800 Subject: [PATCH 3/3] fix: let callback be optional to pass the test case --- types/ember-qunit/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/ember-qunit/index.d.ts b/types/ember-qunit/index.d.ts index ad12f43ffc..9dc93b980b 100644 --- a/types/ember-qunit/index.d.ts +++ b/types/ember-qunit/index.d.ts @@ -164,7 +164,7 @@ declare module 'qunit' { * @param name Title of unit being tested * @param callback Function to close over assertions */ - export function skip(name: string, callback: (this: TestContext, assert: Assert) => void): void; + export function skip(name: string, callback?: (this: TestContext, assert: Assert) => void): void; export default QUnit; }