forked from tradingview/lightweight-charts
-
Notifications
You must be signed in to change notification settings - Fork 39
/
.mocharc.js
33 lines (26 loc) · 796 Bytes
/
.mocharc.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
31
32
33
'use strict';
const path = require('path');
// override tsconfig for tests
process.env.TS_NODE_PROJECT = path.resolve(__dirname, './tests/unittests/tsconfig.composite.json');
const config = {
require: [
'ts-node/register',
],
extension: ['ts'],
checkLeaks: true,
recursive: true,
diff: true,
};
if (process.env.TESTS_REPORT_FILE) {
config.reporter = 'xunit';
// mocha doesn't have this option, it's for other runners (e.g. e2e tests)
config._reporterOptions = {
output: process.env.TESTS_REPORT_FILE,
};
// but mocha accept with form (like from cli) of this option
// e.g. option=value,option2=value
config['reporter-options'] = Object.keys(config._reporterOptions)
.map(option => `${option}=${config._reporterOptions[option]}`)
.join(',');
}
module.exports = config;