diff --git a/addon-test-support/@ember/test-helpers/index.ts b/addon-test-support/@ember/test-helpers/index.ts index 2f628768d..db6fb7c30 100644 --- a/addon-test-support/@ember/test-helpers/index.ts +++ b/addon-test-support/@ember/test-helpers/index.ts @@ -11,6 +11,7 @@ export type { DeprecationFailure, TestContext, Warning, + SetupContextOptions, } from './setup-context'; export { default as setupContext, @@ -25,6 +26,7 @@ export { getWarningsDuringCallback, } from './setup-context'; export { default as teardownContext } from './teardown-context'; +export type { TeardownContextOptions } from './teardown-context'; export { default as setupRenderingContext, render, diff --git a/addon-test-support/@ember/test-helpers/setup-context.ts b/addon-test-support/@ember/test-helpers/setup-context.ts index f416d2a16..d937743ce 100644 --- a/addon-test-support/@ember/test-helpers/setup-context.ts +++ b/addon-test-support/@ember/test-helpers/setup-context.ts @@ -31,6 +31,10 @@ import { Warning, } from './-internal/warnings'; +export interface SetupContextOptions { + resolver?: Resolver | undefined; +} + // This handler exists to provide the underlying data to enable the following methods: // * getDeprecations() // * getDeprecationsDuringCallback() @@ -372,7 +376,7 @@ export const SetUsage = new WeakMap>(); */ export default function setupContext( base: T, - options: { resolver?: Resolver } = {} + options: SetupContextOptions = {} ): Promise { let context = base as T & TestContext; diff --git a/addon-test-support/@ember/test-helpers/teardown-context.ts b/addon-test-support/@ember/test-helpers/teardown-context.ts index a70d93a79..75f92c694 100644 --- a/addon-test-support/@ember/test-helpers/teardown-context.ts +++ b/addon-test-support/@ember/test-helpers/teardown-context.ts @@ -3,6 +3,10 @@ import settled from './settled'; import { _cleanupOnerror } from './setup-onerror'; import { destroy } from '@ember/destroyable'; +export interface TeardownContextOptions { + waitForSettled?: boolean | undefined; +} + /** Used by test framework addons to tear down the provided context after testing is completed. @@ -20,7 +24,7 @@ import { destroy } from '@ember/destroyable'; */ export default function teardownContext( context: TestContext, - options?: { waitForSettled?: boolean } + options: TeardownContextOptions = {} ): Promise { let waitForSettled = true; if (options !== undefined && 'waitForSettled' in options) {