MCPcopy Create free account
hub / github.com/nodejs/node-addon-api / executeTests

Function executeTests

unit-test/test.js:8–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6* Execute tests with given filter conditions as a child process
7*/
8const executeTests = async function () {
9 try {
10 const workingDir = path.join(__dirname, '../');
11 const relativeBuildPath = path.join('../', 'unit-test');
12 const buildPath = path.join(__dirname, './unit-test');
13 const envVars = { ...process.env, REL_BUILD_PATH: relativeBuildPath, BUILD_PATH: buildPath };
14
15 console.log('Starting to run tests in ', buildPath, new Date());
16
17 const code = await runChildProcess('test', { cwd: workingDir, env: envVars });
18
19 if (code !== '0') {
20 process.exitCode = code;
21 process.exit(process.exitCode);
22 }
23
24 console.log('Completed running tests', new Date());
25 } catch (e) {
26 console.log('Error occured running tests', new Date());
27 }
28};
29
30executeTests();

Callers 1

test.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected