From b82fd29eefab15fef9d9b670b46da8ba2ece576f Mon Sep 17 00:00:00 2001 From: Ayushman Chhabra <14110965+ayushmanchhabra@users.noreply.github.com> Date: Fri, 20 Oct 2023 19:46:24 -0400 Subject: [PATCH] test: test resporter is not supported in v16 --- test/e2e/index.js | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/test/e2e/index.js b/test/e2e/index.js index 16d1b6a82..ff0738872 100644 --- a/test/e2e/index.js +++ b/test/e2e/index.js @@ -1,21 +1,26 @@ import { resolve } from "node:path"; import { stdout, version } from "node:process"; import { run } from "node:test"; -import { tap } from "node:test/reporters"; -let tests = [ - resolve("test", "e2e", "addon.js"), - resolve("test", "e2e", "mode.js"), -]; +await executeTests(); -if (version.startsWith("v16")) { - run({ - files: tests, - }); -} else { - run({ - files: tests, - }) - .compose(tap) - .pipe(stdout); -} +async function executeTests() { + let tests = [ + resolve("test", "e2e", "addon.js"), + resolve("test", "e2e", "mode.js"), + ]; + + if (version.startsWith("v16")) { + run({ + files: tests, + }); + } else { + const { tap } = await import("node:test/reporters"); + + run({ + files: tests, + }) + .compose(tap) + .pipe(stdout); + } +} \ No newline at end of file