diff options
Diffstat (limited to 'cli/dts')
-rw-r--r-- | cli/dts/lib.deno.ns.d.ts | 34 | ||||
-rw-r--r-- | cli/dts/lib.deno.unstable.d.ts | 37 |
2 files changed, 33 insertions, 38 deletions
diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index e23f44d9a..46b4bda71 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -113,8 +113,40 @@ declare namespace Deno { * See: https://no-color.org/ */ export const noColor: boolean; - /** **UNSTABLE**: New option, yet to be vetted. */ export interface TestContext { + /** Run a sub step of the parent test or step. Returns a promise + * that resolves to a boolean signifying if the step completed successfully. + * The returned promise never rejects unless the arguments are invalid. + * If the test was ignored the promise returns `false`. + */ + step(t: TestStepDefinition): Promise<boolean>; + + /** Run a sub step of the parent test or step. Returns a promise + * that resolves to a boolean signifying if the step completed successfully. + * The returned promise never rejects unless the arguments are invalid. + * If the test was ignored the promise returns `false`. + */ + step( + name: string, + fn: (t: TestContext) => void | Promise<void>, + ): Promise<boolean>; + } + + export interface TestStepDefinition { + fn: (t: TestContext) => void | Promise<void>; + name: string; + ignore?: boolean; + /** Check that the number of async completed ops after the test step is the same + * as number of dispatched ops. Defaults to the parent test or step's value. */ + sanitizeOps?: boolean; + /** Ensure the test step does not "leak" resources - ie. the resource table + * after the test has exactly the same contents as before the test. Defaults + * to the parent test or step's value. */ + sanitizeResources?: boolean; + /** Ensure the test step does not prematurely cause the process to exit, + * for example via a call to `Deno.exit`. Defaults to the parent test or + * step's value. */ + sanitizeExit?: boolean; } export interface TestDefinition { diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 82cb2cc8f..988f01c81 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -934,43 +934,6 @@ declare namespace Deno { */ export function sleepSync(millis: number): void; - /** **UNSTABLE**: New option, yet to be vetted. */ - export interface TestContext { - /** Run a sub step of the parent test with a given name. Returns a promise - * that resolves to a boolean signifying if the step completed successfully. - * The returned promise never rejects unless the arguments are invalid. - * If the test was ignored, the promise returns `false`. - */ - step(t: TestStepDefinition): Promise<boolean>; - - /** Run a sub step of the parent test with a given name. Returns a promise - * that resolves to a boolean signifying if the step completed successfully. - * The returned promise never rejects unless the arguments are invalid. - * If the test was ignored, the promise returns `false`. - */ - step( - name: string, - fn: (t: TestContext) => void | Promise<void>, - ): Promise<boolean>; - } - - /** **UNSTABLE**: New option, yet to be vetted. */ - export interface TestStepDefinition { - fn: (t: TestContext) => void | Promise<void>; - name: string; - ignore?: boolean; - /** Check that the number of async completed ops after the test is the same - * as number of dispatched ops. Defaults to true. */ - sanitizeOps?: boolean; - /** Ensure the test case does not "leak" resources - ie. the resource table - * after the test has exactly the same contents as before the test. Defaults - * to true. */ - sanitizeResources?: boolean; - /** Ensure the test case does not prematurely cause the process to exit, - * for example via a call to `Deno.exit`. Defaults to true. */ - sanitizeExit?: boolean; - } - /** **UNSTABLE**: new API, yet to be vetted. * * A generic transport listener for message-oriented protocols. */ |