-
Notifications
You must be signed in to change notification settings - Fork 471
/
Copy pathtest.js
30 lines (24 loc) · 909 Bytes
/
test.js
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
'use strict';
const path = require('path');
const runChildProcess = require('./spawnTask').runChildProcess;
/*
* Execute tests with given filter conditions as a child process
*/
const executeTests = async function () {
try {
const workingDir = path.join(__dirname, '../');
const relativeBuildPath = path.join('../', 'unit-test');
const buildPath = path.join(__dirname, './unit-test');
const envVars = { ...process.env, REL_BUILD_PATH: relativeBuildPath, BUILD_PATH: buildPath };
console.log('Starting to run tests in ', buildPath, new Date());
const code = await runChildProcess('test', { cwd: workingDir, env: envVars });
if (code !== '0') {
process.exitCode = code;
process.exit(process.exitCode);
}
console.log('Completed running tests', new Date());
} catch (e) {
console.log('Error occured running tests', new Date());
}
};
executeTests();