-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwallaby.js
45 lines (44 loc) · 1.33 KB
/
wallaby.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
35
36
37
38
39
40
41
42
43
44
45
module.exports = () => {
return {
'files': [
{ pattern: 'fixtures/**/*', instrument: false },
{ pattern: 'scripts/*', instrument: false },
{ pattern: 'package.json', instrument: false },
{ pattern: 'tsconfig.*', instrument: false },
{ pattern: '__komondor__/**/*', instrument: false },
'src/**/*.ts',
'!src/**/*.spec.ts'
],
'tests': [
'src/**/*.spec.ts'
],
'env': {
'type': 'node'
},
hints: {
allowIgnoringCoverageInTests: true,
ignoreCoverage: /istanbul ignore next/
},
setup(wallaby) {
const fs = require('fs');
if (fs.patched) return;
const path = require('path');
const writeFile = fs.writeFileSync;
fs.writeFileSync = function(file, content) {
if (/__komondor__/.test(file)) {
writeFile(path.join(wallaby.localProjectDir, file.replace(wallaby.projectCacheDir, '')), content);
}
return writeFile.apply(this, arguments);
}
const mkdirSync = fs.mkdirSync;
fs.mkdirSync = function (dir, mode) {
if (/__komondor__/.test(dir)) {
mkdirSync(path.join(wallaby.localProjectDir, dir.replace(wallaby.projectCacheDir, '')), mode);
}
return mkdirSync.apply(this, arguments);
}
fs.patched = true;
},
'testFramework': 'jest'
}
}