-
-
Save GiuseppeMP/6829a4529507f58ab6b5af161ac35811 to your computer and use it in GitHub Desktop.
Jest Multi Project Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { resolve } = require('path') | |
| const root = resolve(__dirname, '..') | |
| module.exports = { | |
| rootDir: root, | |
| displayName: 'eslint', | |
| runner: 'jest-runner-eslint', | |
| testMatch: ['<rootDir>/src/**/*.js', '<rootDir>/config/*.js'], | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| projects: [ | |
| '<rootDir>/jest-eslint.config.js', | |
| '<rootDir>/jest-prettier.config.js', | |
| ], | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { resolve } = require('path') | |
| const root = resolve(__dirname, '..') | |
| module.exports = { | |
| rootDir: root, | |
| displayName: 'prettier', | |
| runner: 'jest-runner-write-prettier', | |
| testMatch: ['<rootDir>/src/**/*.js', '<rootDir>/config/*.js', '*.js'], | |
| moduleFileExtensions: ['js'], | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { resolve } = require('path') | |
| const root = resolve(__dirname, '..') | |
| module.exports = { | |
| rootDir: root, | |
| displayName: 'test', | |
| testPathIgnorePatterns: ['/node_modules/', '/cypress/'], | |
| collectCoverageFrom: [ | |
| 'src/**/*.js', | |
| '!src/index.js', | |
| '!**/fixtures/**/*.js', | |
| '!**/**/test-setup.js', | |
| '!**/**/*.spec.js', | |
| '!**/**/*.mock.js', | |
| '!**/**/*.test.js', | |
| ], | |
| coverageThreshold: { | |
| global: { | |
| statements: 90, | |
| branches: 75, | |
| functions: 85, | |
| lines: 90, | |
| }, | |
| }, | |
| setupTestFrameworkScriptFile: '<rootDir>/jest-setup.js', | |
| testEnvironment: 'jest-environment-jsdom-global', | |
| transform: { | |
| '^.+\\.jsx?$': 'babel-jest', | |
| '.*': '@brimstone/jest-static-assets-mocker', | |
| }, | |
| snapshotSerializers: [ | |
| 'jest-glamor-react', | |
| 'enzyme-to-json/serializer', | |
| 'snapshot-diff-serializer', | |
| ], | |
| transformIgnorePatterns: [ | |
| 'node_modules/(?!(css-wipe|@wf-titan/kashyyyk-theme|@inferno/effigy))', | |
| ], | |
| testURL: 'https://example.com/', | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| projects: [ | |
| '<rootDir>/jest-test.config.js', | |
| '<rootDir>/jest-eslint.config.js', | |
| '<rootDir>/jest-prettier.config.js', | |
| ], | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment