diff options
author | Leo Kettmeir <crowlkats@toaxl.com> | 2023-01-24 15:41:01 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-24 15:41:01 +0100 |
commit | 2027d98a8e9e530277ab301841872cdea7e2d590 (patch) | |
tree | 04d541e094c28d039b7d88cf699cb01e24bf07bd /cli/tsc/dts/lib.deno.ns.d.ts | |
parent | fc2e00152b162280e78b06028d51274e33275629 (diff) |
feat: allow first arg in test step to be a function (#17096)
Diffstat (limited to 'cli/tsc/dts/lib.deno.ns.d.ts')
-rw-r--r-- | cli/tsc/dts/lib.deno.ns.d.ts | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index 7473b1415..b6add6e4b 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -668,6 +668,25 @@ declare namespace Deno { name: string, fn: (t: TestContext) => void | Promise<void>, ): 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`. + * + * ```ts + * Deno.test(async function aParentTest(t) { + * console.log("before the step"); + * await t.step(function step1(t) { + * console.log("current step:", t.name); + * }); + * console.log("after the step"); + * }); + * ``` + */ + step(fn: (t: TestContext) => void | Promise<void>): Promise<boolean>; } /** @category Testing */ |