Skip to content

Commit

Permalink
frontend: jest coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ulfgebhardt committed Nov 7, 2022
1 parent 4cd8c58 commit f57e11d
Show file tree
Hide file tree
Showing 3 changed files with 814 additions and 416 deletions.
37 changes: 37 additions & 0 deletions webapp/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports = {
verbose: true,
collectCoverage: true,
collectCoverageFrom: [
'**/*.{js,vue}',
'!**/?(*.)+(spec|test|story).js?(x)',
'!**/node_modules/**',
'!**/.nuxt/**',
'!**/storybook/**',
'!**/coverage/**',
'!**/config/**',
'!**/maintenance/**',
'!**/plugins/**',
'!**/.eslintrc.js',
'!**/.prettierrc.js',
'!**/nuxt.config.js'
],
coverageReporters: ['lcov', 'text'],
setupFiles: ['<rootDir>/test/registerContext.js', '<rootDir>/test/testSetup.js'],
transform: {
'.*\\.(vue)$': 'vue-jest',
'^.+\\.js$': 'babel-jest'
},
testMatch: ['**/?(*.)+(spec|test).js?(x)'],
modulePathIgnorePatterns: ['<rootDir>/build/'],
moduleNameMapper: {
'\\.(svg)$': '<rootDir>/test/fileMock.js',
'\\.(css|less)$': 'identity-obj-proxy',
'^@/(.*)$': '<rootDir>/src/$1',
'^~/(.*)$': '<rootDir>/$1'
},
moduleFileExtensions: [
'js',
'json',
'vue'
]
}
48 changes: 3 additions & 45 deletions webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,51 +17,9 @@
"lint": "eslint --ext .js,.vue .",
"locales": "../scripts/translations/missing-keys.sh && ../scripts/translations/sort.sh",
"precommit": "yarn lint",
"test": "cross-env NODE_ENV=test jest --coverage",
"test": "cross-env NODE_ENV=test jest --runInBand --coverage --forceExit --detectOpenHandles",
"test:unit:debug": "node --inspect-brk ./node_modules/jest/bin/jest.js --no-cache --runInBand"
},
"jest": {
"verbose": true,
"collectCoverageFrom": [
"**/*.{js,vue}",
"!**/?(*.)+(spec|test|story).js?(x)",
"!**/node_modules/**",
"!**/.nuxt/**",
"!**/storybook/**",
"!**/coverage/**",
"!**/config/**",
"!**/maintenance/**",
"!**/plugins/**",
"!**/.eslintrc.js",
"!**/.prettierrc.js",
"!**/nuxt.config.js"
],
"coverageReporters": [
"lcov"
],
"transform": {
".*\\.(vue)$": "vue-jest",
"^.+\\.js$": "babel-jest"
},
"moduleFileExtensions": [
"js",
"json",
"vue"
],
"moduleNameMapper": {
"\\.(svg)$": "<rootDir>/test/fileMock.js",
"\\.(css|less)$": "identity-obj-proxy",
"^@/(.*)$": "<rootDir>/src/$1",
"^~/(.*)$": "<rootDir>/$1"
},
"setupFiles": [
"<rootDir>/test/registerContext.js",
"<rootDir>/test/testSetup.js"
],
"testMatch": [
"**/?(*.)+(spec|test).js?(x)"
]
},
"dependencies": {
"@human-connection/styleguide": "0.5.22",
"@nuxtjs/apollo": "^4.0.0-rc19",
Expand Down Expand Up @@ -120,7 +78,7 @@
"async-validator": "^3.2.4",
"babel-core": "~7.0.0-bridge.0",
"babel-eslint": "~10.1.0",
"babel-jest": "~25.3.0",
"babel-jest": "~29.2.2",
"babel-loader": "~8.1.0",
"babel-plugin-require-context-hook": "^1.0.0",
"babel-preset-vue": "~2.0.2",
Expand All @@ -147,7 +105,7 @@
"storybook-vue-router": "^1.0.7",
"style-loader": "~0.23.1",
"style-resources-loader": "~1.3.3",
"vue-jest": "~3.0.5",
"vue-jest": "~3.0.7",
"vue-svg-loader": "~0.16.0",
"vue-template-compiler": "^2.6.11"
}
Expand Down
Loading

0 comments on commit f57e11d

Please # to comment.