build(test): don't collect coverage from integration test files
MODIFY
jest.config.js
jest.config.js
+const SCOPE_ALL = 'all';
+const SCOPE_UNIT = 'unit';
+const SCOPE = process.env.SCOPE || SCOPE_ALL;
+
module.exports = {
transform: {
'^.+\\.tsx?$': 'ts-jest'
},
- testRegex: '(/__tests__/.*|\\.(test|spec))\\.(ts|tsx)$',
+ testRegex: SCOPE === SCOPE_UNIT
+ ? '^((?!integration).)*\.spec\.ts$'
+ : '.?(spec|integration\.spec)\.ts$',
coverageDirectory: './coverage/',
- coveragePathIgnorePatterns: ['spec-util.ts$', '.d.ts$'],
+ coveragePathIgnorePatterns: ['spec-util.ts$', '.d.ts$', '.spec.ts'],
collectCoverageFrom : ['packages/**/*.ts'],
moduleFileExtensions: [
'ts',

MODIFY
package.json
package.json
"benchmark": "make -C benchmarks",
"lint": "tslint --config tslint.json --project tsconfig.spec.json",
"test": "jest --expand",
- "test:coverage": "jest --expand --coverage",
+ "test:coverage": "SCOPE=unit jest --expand --coverage",
"test:watch": "jest --expand --onlyChanged --watch",
"prepublish": "npm run test",
"publish": "lerna publish",

build(test): don't collect coverage from integration test files