Add eslint and prettier support

This commit is contained in:
Joseph Garrone 2020-05-27 22:02:44 +02:00
parent 95d413a2ce
commit 89f37d738b
20 changed files with 1971 additions and 170 deletions

View file

@ -1,40 +1,33 @@
//This will not run on deno, we need a separate index to run our tests.
//This will not run on deno, we need a separate test runner for Deno (./mod.ts).
import * as child_process from "child_process";
import * as path from "path";
import { Deferred } from "evt/tools/Deferred";
const names = ["myFunction", "myObject", "getProjectRoot"];
(async () => {
if (!!process.env.FORK) {
process.once("unhandledRejection", error => { throw error; });
process.once("unhandledRejection", error => {
throw error;
});
require(process.env.FORK);
return;
}
for (const name of [
"myFunction",
"myObject",
"getProjectRoot"
]) {
for (const name of names) {
console.log(`Running: ${name}`);
const dExitCode = new Deferred<number>();
child_process.fork(
__filename,
undefined,
{ "env": { "FORK": path.join(__dirname, name) } }
)
child_process
.fork(__filename, undefined, {
"env": { "FORK": path.join(__dirname, name) },
})
.on("message", console.log)
.once("exit", code => dExitCode.resolve(code ?? 1))
;
.once("exit", code => dExitCode.resolve(code ?? 1));
const exitCode = await dExitCode.pr;
@ -44,7 +37,5 @@ import { Deferred } from "evt/tools/Deferred";
}
console.log("\n");
}
})();