From 1dd1aba2448c6c8a5a0370c4066a68aca06b859b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 29 Dec 2023 16:18:08 +0100 Subject: fix(node): support nested tests in "node:test" (#21717) Closes https://github.com/denoland/deno/issues/21679 --- ext/node/polyfills/testing.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ext/node/polyfills/testing.ts') diff --git a/ext/node/polyfills/testing.ts b/ext/node/polyfills/testing.ts index 83e8f6f0b..57ef8e795 100644 --- a/ext/node/polyfills/testing.ts +++ b/ext/node/polyfills/testing.ts @@ -56,7 +56,10 @@ class NodeTestContext { const prepared = prepareOptions(name, options, fn, {}); return this.#denoContext.step({ name: prepared.name, - fn: prepared.fn, + fn: async (denoTestContext) => { + const newNodeTextContext = new NodeTestContext(denoTestContext); + await prepared.fn(newNodeTextContext); + }, ignore: prepared.options.todo || prepared.options.skip, }).then(() => undefined); } -- cgit v1.2.3