-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwallaby.js
38 lines (35 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
//
// Wallaby config reads tsconfig.json and jest.config.js out of the box
//
module.exports = function(wallaby) {
return {
files: [
'**/src/**/*.{ts,tsx}',
{ pattern: '**/*.json', instrument: false },
{ pattern: '**/*.js', instrument: false },
'!**/src/**/*.test.{ts,tsx}',
'!**/src/**/*.story.tsx',
'!**/node_modules/**/*',
'!**/dist/**/*',
'!**/build/**/*',
],
tests: ['**/src/**/*.test.{ts,tsx}', '!**/node_modules/**/*'],
env: { type: 'node', runner: 'node' },
testFramework: 'jest',
// wallaby doesnt support jest multi-projects: https://github.com/wallabyjs/public/issues/1856
// therefore re-specify the tsconfig paths mappings as don't have paths in the root tsconfig.json
// also to fix the "src/" tsconfig path alias appearing in all the projects, tell wallaby about multiple project roots to search
setup: () => {
const jestConfig = require('./jest.config');
jestConfig.moduleNameMapper = {
...jestConfig.moduleNameMapper,
'^@monorepo/common/(.*)$': '<rootDir>/common/src/$1',
};
jestConfig.modulePaths = ['<rootDir>/common', '<rootDir>/app1', '<rootDir>/app2']
wallaby.testFramework.configure(jestConfig);
},
reportConsoleErrorAsError: true,
lowCoverageThreshold: 80,
debug: true,
};
};