-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcoverage.js
33 lines (29 loc) · 971 Bytes
/
coverage.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
var wrench = require('wrench');
var exec = require('child_process').exec;
var run = function() {
wrench.mkdirSyncRecursive('build/test');
wrench.copyDirSyncRecursive('test', 'build/test');
wrench.rmdirSyncRecursive('reports', true);
wrench.mkdirSyncRecursive('reports/coverage');
wrench.copyDirSyncRecursive('template/', 'reports/');
require('../node_modules/jasmine-node/lib/jasmine-node/index.js');
require('../src/jasmine.jscoverage_reporter');
var jasmineEnv = jasmine.getEnv();
jasmineEnv.addReporter(new jasmine.JSCoverageReporter('./reports'));
require('../node_modules/jasmine-node/lib/jasmine-node/cli.js');
};
wrench.rmdirSyncRecursive('build', true);
wrench.mkdirSyncRecursive('build/src');
exec('jscoverage src build/src', function(err, stdout, stderr) {
if (stdout) {
console.log(stdout);
}
if (stderr) {
console.error(stderr);
}
if (err) {
console.error('exec error', err);
process.exit(1);
}
run();
});