|
1 | 1 | import path from "node:path"; |
2 | | -import { test, type TestContext } from "node:test"; |
| 2 | +import { test } from "node:test"; |
3 | 3 |
|
4 | 4 | import { listDirectoryEntries, runFileInSubprocess } from "./tests.ts"; |
5 | 5 |
|
6 | 6 | const ROOT_PATH = path.resolve(import.meta.dirname, "..", ".."); |
7 | 7 | const TESTS_ROOT_PATH = path.join(ROOT_PATH, "tests"); |
8 | 8 |
|
9 | | -async function populateSuite( |
10 | | - testContext: TestContext, |
| 9 | +function populateSuite( |
11 | 10 | dir: string |
12 | | -): Promise<void> { |
| 11 | +) { |
13 | 12 | const { directories, files } = listDirectoryEntries(dir); |
14 | 13 |
|
15 | 14 | for (const file of files) { |
16 | | - await testContext.test(file, () => runFileInSubprocess(dir, file)); |
| 15 | + test(path.relative(TESTS_ROOT_PATH, path.join(dir, file)), () => runFileInSubprocess(dir, file)); |
17 | 16 | } |
18 | 17 |
|
19 | 18 | for (const directory of directories) { |
20 | | - await testContext.test(directory, async (subTest) => { |
21 | | - await populateSuite(subTest, path.join(dir, directory)); |
22 | | - }); |
| 19 | + populateSuite(path.join(dir, directory)); |
23 | 20 | } |
24 | 21 | } |
25 | 22 |
|
26 | | -test("harness", async (t) => { |
27 | | - await populateSuite(t, path.join(TESTS_ROOT_PATH, "harness")); |
28 | | -}); |
29 | | - |
30 | | -test("js-native-api", async (t) => { |
31 | | - await populateSuite(t, path.join(TESTS_ROOT_PATH, "js-native-api")); |
32 | | -}); |
33 | | - |
34 | | -test("node-api", async (t) => { |
35 | | - await populateSuite(t, path.join(TESTS_ROOT_PATH, "node-api")); |
36 | | -}); |
| 23 | +populateSuite(path.join(TESTS_ROOT_PATH, "harness")); |
| 24 | +populateSuite(path.join(TESTS_ROOT_PATH, "js-native-api")); |
| 25 | +populateSuite(path.join(TESTS_ROOT_PATH, "node-api")); |
0 commit comments