DEV;Add Jest coverage setting for CI

This commit is contained in:
Roman Jaroš 2021-01-21 21:19:26 +01:00
parent a0f41a4e2c
commit 67961b47a3
3 changed files with 6 additions and 3 deletions

1
.gitignore vendored
View file

@ -5,6 +5,7 @@
# project # project
node_modules/ node_modules/
dist/ dist/
temp/
lerna-debug.log lerna-debug.log
tsconfig.tsbuildinfo tsconfig.tsbuildinfo

View file

@ -4,7 +4,6 @@ module.exports = {
}, },
testRegex: '(/__tests__/.*|(-|/)(test))\\.tsx?$', testRegex: '(/__tests__/.*|(-|/)(test))\\.tsx?$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'], moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json'],
modulePathIgnorePatterns: ['<rootDir>/.vscode/'],
moduleNameMapper: { moduleNameMapper: {
'^documentation(.*)$': '<rootDir>/packages/documentation/src/$1', '^documentation(.*)$': '<rootDir>/packages/documentation/src/$1',
'^@romanjaros/treejs-components(.*)$': '<rootDir>/packages/treejs-components/src/$1', '^@romanjaros/treejs-components(.*)$': '<rootDir>/packages/treejs-components/src/$1',
@ -18,6 +17,9 @@ module.exports = {
'^@romanjaros/treejs-types(.*)$': '<rootDir>/packages/treejs-types/src/$1', '^@romanjaros/treejs-types(.*)$': '<rootDir>/packages/treejs-types/src/$1',
'\\.(css|less|sass|scss)$': '<rootDir>/tests/emptyMock.ts', '\\.(css|less|sass|scss)$': '<rootDir>/tests/emptyMock.ts',
}, },
collectCoverage: !!process.env.CI,
coverageReporters: ['lcov'],
coverageDirectory: '<rootDir>/temp/jest',
// enzyme // enzyme
snapshotSerializers: ['enzyme-to-json/serializer'], snapshotSerializers: ['enzyme-to-json/serializer'],

View file

@ -18,8 +18,8 @@
"build:module": "lerna run --ignore documentation build", "build:module": "lerna run --ignore documentation build",
"clean:module": "lerna run --ignore documentation clean", "clean:module": "lerna run --ignore documentation clean",
"serve": "http-server dist/client", "serve": "http-server dist/client",
"ci:lint": "npm run lint", "ci:lint": "cross-env CI=true npm run lint",
"ci:test": "npm run test", "ci:test": "cross-env CI=true npm run test",
"ci:test-e2e": "nightwatch", "ci:test-e2e": "nightwatch",
"ci:build": "lerna run --stream --scope documentation build", "ci:build": "lerna run --stream --scope documentation build",
"ci:increase-version": "lerna version --no-git-tag-version --no-push --yes" "ci:increase-version": "lerna version --no-git-tag-version --no-push --yes"