Skip to content

Commit

Permalink
【fix】sonar ts文件覆盖率行不对应问题
Browse files Browse the repository at this point in the history
  • Loading branch information
songyumeng committed Aug 19, 2024
1 parent d871425 commit 8007396
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const babelConfig = require('./babel.config')();

process.env.VUE_CLI_BABEL_TARGET_NODE = true;
process.env.VUE_CLI_BABEL_TRANSPILE_MODULES = true;
// babelConfig.inputSourceMap = false;

module.exports = {
rootDir: path.resolve(__dirname),
Expand All @@ -20,18 +21,12 @@ module.exports = {
'@i18n/(.*)$': '<rootDir>/src/common/$1',
'@leaflet/(.*)$': '<rootDir>/src/leaflet/$1',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':
'<rootDir>/test/unit/assetsTransformer.js',
'<rootDir>/test/unit/assetsTransformer.js',
'^axios$': require.resolve('axios')
},
transform: {
'^.+\\.ts$': [
'<rootDir>/node_modules/babel-jest',
{ extends: './babel.config.js', presets: ['@babel/preset-typescript'] }
],
'^.+\\.js$': [
'<rootDir>/node_modules/babel-jest',
{ extends: './babel.config.js', presets: ['@babel/preset-typescript'] }
],
'^.+\\.ts$': '<rootDir>/node_modules/ts-jest',
'^.+\\.js$': '<rootDir>/node_modules/babel-jest',
'.*\\.(vue)$': '<rootDir>/node_modules/vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': '<rootDir>/node_modules/jest-transform-stub'
},
Expand All @@ -51,8 +46,13 @@ module.exports = {
'node_modules/(?!(mapbox-gl|axios|element-ui|ant-design-vue|geographic-coordinate-converter|videojs-flvjs-es6|vue-videojs7|three)/)'
],
modulePaths: ['src', 'node_modules'],
reporters: ['default', 'jest-teamcity'],
globals: {},
reporters: ["default", "jest-teamcity"],
globals: {
'ts-jest': {
tsConfig: '<rootDir>/tsconfig.json',
babelConfig: babelConfig
}
},

cache: false
};

0 comments on commit 8007396

Please sign in to comment.