From 0df18542499d1220f1182496d3b7028eef243eb0 Mon Sep 17 00:00:00 2001 From: Yongwook Choi Date: Wed, 6 Apr 2022 23:51:38 +0900 Subject: feat(test): Add "name", "origin" and "parent" to "Deno.TestContext" (#14007) This commit adds following fields to "Deno.TestContext" interface: - name - origin - parent These are prerequisites for supporting snapshot functionality in "std/testing". --- cli/dts/lib.deno.ns.d.ts | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'cli/dts') diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index d55ac231e..485b3d490 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -250,6 +250,19 @@ declare namespace Deno { } export interface TestContext { + /** + * The current test name. + */ + name: string; + /** + * File Uri of the current test code. + */ + origin: string; + /** + * Parent test context. + */ + parent?: 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. @@ -270,6 +283,9 @@ declare namespace Deno { export interface TestStepDefinition { fn: (t: TestContext) => void | Promise; + /** + * The current test name. + */ name: string; ignore?: boolean; /** Check that the number of async completed ops after the test step is the same @@ -287,6 +303,9 @@ declare namespace Deno { export interface TestDefinition { fn: (t: TestContext) => void | Promise; + /** + * The current test name. + */ name: string; ignore?: boolean; /** If at least one test has `only` set to true, only run tests that have -- cgit v1.2.3