Skip to content

Commit

Permalink
FIREFLY-1522: Extract jest from package.json in a base config, and ov…
Browse files Browse the repository at this point in the history
…erride it
  • Loading branch information
jaladh-singhal committed Jul 25, 2024
1 parent 5d0e4c0 commit b4fe4ca
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 30 deletions.
34 changes: 34 additions & 0 deletions __jest__/jest.base.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Jest config that is shared by all the apps

/* eslint-env node */

module.exports = {
'verbose': true,
'clearMocks': true,
'collectCoverage': true,
'coverageDirectory': '../../build/dist/reports/firefly',
'coverageReporters': ['lcov'],
'moduleFileExtensions': [
'js',
'jsx'
],
'moduleDirectories': [
'node_modules',
'js'
],
'setupFiles': [
'<rootDir>/../../__jest__/InitTest.js'
],
'moduleNameMapper': {
'^.+\\?raw$': '<rootDir>/../../__jest__/fileMock.js',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': '<rootDir>/../../__jest__/fileMock.js',
'\\.(css|less)$': '<rootDir>/../../__jest__/styleMock.js',
'^firefly/(.*)$': '<rootDir>/js/$1'
},
'transform': {
'^.+\\.jsx?$': '<rootDir>/../../__jest__/jest.transform.js'
},
'globals': {
'__PROPS__': {}
}
};
8 changes: 8 additions & 0 deletions src/firefly/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/* eslint-env node */

const baseConfig = require('../../__jest__/jest.base.config');

module.exports = {
...baseConfig,
//add overrides here (if any)
};
30 changes: 0 additions & 30 deletions src/firefly/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,36 +6,6 @@
"test-unit": "node ../../node_modules/jest/bin/jest --passWithNoTests",
"test-debug": "node --inspect-brk ../../node_modules/jest/bin/jest --runInBand --passWithNoTests"
},
"jest": {
"verbose": true,
"clearMocks": true,
"collectCoverage": true,
"coverageDirectory": "../../build/dist/reports/firefly",
"coverageReporters": ["lcov"],
"moduleFileExtensions": [
"js",
"jsx"
],
"moduleDirectories": [
"node_modules",
"js"
],
"setupFiles": [
"<rootDir>/../../__jest__/InitTest.js"
],
"moduleNameMapper": {
"^.+\\?raw$": "<rootDir>/../../__jest__/fileMock.js",
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/../../__jest__/fileMock.js",
"\\.(css|less)$": "<rootDir>/../../__jest__/styleMock.js",
"^firefly/(.*)$": "<rootDir>/js/$1"
},
"transform": {
"^.+\\.jsx?$": "<rootDir>/../../__jest__/jest.transform.js"
},
"globals": {
"__PROPS__": {}
}
},
"version": "0.0.0",
"license": "SEE LICENSE IN License.txt"
}

0 comments on commit b4fe4ca

Please sign in to comment.