-
Notifications
You must be signed in to change notification settings - Fork 1
/
wallaby.js
32 lines (25 loc) · 925 Bytes
/
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
const path = require('path');
const packages = ['expect-snapshot', 'mock-store', 'mount-hoc', 'test-saga'];
module.exports = wallaby => {
addPackagesToNodePath(wallaby);
return {
files: ['packages/**/*.js', '!**/*.test.js', '!**/node_modules/**'],
tests: ['**/*.test.js', '!**/node_modules/**'],
env: {
type: 'node',
runner: 'node'
},
compilers: {
'**/*.js': wallaby.compilers.babel()
},
testFramework: 'jest'
};
};
/* special setup for monorepos: need to add the node_modules directories from all packages to the path */
function addPackagesToNodePath(wallaby) {
const paths = packages.map(pkg => path.join(wallaby.localProjectDir, `packages/${pkg}/node_modules`));
if (process.env.NODE_PATH) {
paths.unshift(process.env.NODE_PATH);
}
process.env.NODE_PATH = paths.join(path.delimiter);
}