summaryrefslogtreecommitdiff
path: root/ext/node
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-12-29 16:18:08 +0100
committerGitHub <noreply@github.com>2023-12-29 16:18:08 +0100
commit1dd1aba2448c6c8a5a0370c4066a68aca06b859b (patch)
tree1d2b9a8a24502fa925791de935bb4690b91c27c8 /ext/node
parent576b20aa005c233b95afe6e3692a899ae8f755f2 (diff)
fix(node): support nested tests in "node:test" (#21717)
Closes https://github.com/denoland/deno/issues/21679
Diffstat (limited to 'ext/node')
-rw-r--r--ext/node/polyfills/testing.ts5
1 files changed, 4 insertions, 1 deletions
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);
}