-
-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathrun-tests.ts
More file actions
39 lines (31 loc) · 964 Bytes
/
run-tests.ts
File metadata and controls
39 lines (31 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import path from "node:path";
import { test } from "node:test";
import { listDirectoryEntries, runFileInSubprocess } from "./tests.ts";
const ROOT_PATH = path.resolve(import.meta.dirname, "..", "..");
const TESTS_ROOT_PATH = path.join(ROOT_PATH, "tests");
const ASSERT_MODULE_PATH = path.join(
ROOT_PATH,
"implementors",
"node",
"assert.js"
);
const LOAD_ADDON_MODULE_PATH = path.join(
ROOT_PATH,
"implementors",
"node",
"load-addon.js"
);
function populateSuite(
dir: string
) {
const { directories, files } = listDirectoryEntries(dir);
for (const file of files) {
test(path.relative(TESTS_ROOT_PATH, path.join(dir, file)), () => runFileInSubprocess(dir, file));
}
for (const directory of directories) {
populateSuite(path.join(dir, directory));
}
}
populateSuite(path.join(TESTS_ROOT_PATH, "harness"));
populateSuite(path.join(TESTS_ROOT_PATH, "js-native-api"));
populateSuite(path.join(TESTS_ROOT_PATH, "node-api"));