updated to reflect the testing infrastructure changes from sealgen
Summary: Ref T2697 Reviewers: #testers, kuba-orlik Reviewed By: #testers, kuba-orlik Subscribers: kuba-orlik Maniphest Tasks: T2697 Differential Revision: https://hub.sealcode.org/D1323master
parent
7d8417658f
commit
84a9b530d4
@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
require: ["ts-node/register", "source-map-support/register"],
|
||||
recursive: true,
|
||||
timeout: "10000",
|
||||
spec: ["src/*.test.ts", "src/**/*.test.ts"],
|
||||
};
|
||||
@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "@istanbuljs/nyc-config-typescript",
|
||||
"all": true,
|
||||
"include": "src",
|
||||
"exclude": ""
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,68 +0,0 @@
|
||||
const mri = require("mri");
|
||||
const { spawn } = require("child_process");
|
||||
|
||||
const argv = process.argv.slice(2);
|
||||
const args = mri(argv);
|
||||
|
||||
const bin_dir = "./node_modules/.bin/";
|
||||
|
||||
const mocha = bin_dir + "mocha";
|
||||
|
||||
let mocha_options = [
|
||||
"--recursive",
|
||||
"--timeout=10000",
|
||||
"--require",
|
||||
"source-map-support/register",
|
||||
"-r",
|
||||
" ts-node/register"
|
||||
];
|
||||
|
||||
if (args["test-report"]) {
|
||||
mocha_options = [
|
||||
...mocha_options,
|
||||
"--reporter",
|
||||
"xunit",
|
||||
"--reporter-option",
|
||||
"output=.xunit",
|
||||
];
|
||||
}
|
||||
|
||||
const mocha_files = ["src/**/*.test.ts"];
|
||||
|
||||
let command = [mocha, ...mocha_options, ...mocha_files];
|
||||
|
||||
if (args.cover) {
|
||||
const nyc = [
|
||||
bin_dir + "nyc",
|
||||
"-all",
|
||||
"--exclude",
|
||||
"lib",
|
||||
"--source-map",
|
||||
"false",
|
||||
];
|
||||
if (args["cover-html"]) {
|
||||
nyc.push("--reporter", "lcov");
|
||||
} else {
|
||||
nyc.push("--reporter", "clover");
|
||||
}
|
||||
command = [...nyc, ...command];
|
||||
}
|
||||
|
||||
if (args.debug) {
|
||||
command = ["node", "inspect", ...command];
|
||||
}
|
||||
|
||||
console.log("spawning mocha...", command);
|
||||
|
||||
const proc = spawn(command[0], command.slice(1), {
|
||||
stdio: "inherit",
|
||||
env: process.env,
|
||||
});
|
||||
|
||||
proc.on("exit", function (code) {
|
||||
if (args["test-report"]) {
|
||||
process.exit(0);
|
||||
} else {
|
||||
process.exit(code);
|
||||
}
|
||||
});
|
||||
Loading…
Reference in New Issue