-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
34 lines (26 loc) · 905 Bytes
/
index.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
34
'use strict';
// https://stackoverflow.com/questions/29011457/jasmine-jasmine-reporters-on-nodejs-missing-output
const Jasmine = require('jasmine'),
reporters = require('jasmine-reporters'),
fs = require('fs');
const runner = (jasmineCofigFile, configure) => {
const reportsPath = `./reports`;
if (!fs.existsSync(reportsPath)) {
fs.mkdirSync(reportsPath);
}
const junitReporter = new reporters.JUnitXmlReporter({
savePath: reportsPath,
consolidateAll: false
});
const jasmineEnv = new Jasmine();
jasmineEnv.loadConfigFile(jasmineCofigFile);
jasmineEnv.addReporter(junitReporter);
if (configure && typeof configure === 'function') {
configure(jasmine);
}
jasmineEnv.execute();
};
runner('./config.json', jasmine => {
// maximum 10 minutes per test
jasmine.DEFAULT_TIMEOUT_INTERVAL = 10 * 60 * 1000;
});