test: add testing framework
This commit is contained in:
parent
31d900ed40
commit
f109172cc4
12 changed files with 563 additions and 24 deletions
20
test/run-tests.ts
Normal file
20
test/run-tests.ts
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
*/
|
||||
|
||||
import { fork } from "child_process";
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
|
||||
import { shuffle } from "./lib/utils";
|
||||
|
||||
const TEST_SUITES_DIR = path.join(__dirname, "test-suites");
|
||||
|
||||
const files = fs.readdirSync(TEST_SUITES_DIR);
|
||||
// Shuffle test suites to detect ordering dependencies between them.
|
||||
shuffle(files);
|
||||
for (const file of files) {
|
||||
const fullPath = path.join(TEST_SUITES_DIR, file);
|
||||
fork(path.relative(process.cwd(), fullPath));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue