Last active
January 16, 2020 04:47
-
-
Save Roms1383/e149de4b259442cd36ffeb6e1e130848 to your computer and use it in GitHub Desktop.
Medium - Dynamically matching files in Jest - using different configuration files
This file contains 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 = { | |
...require('./jest.config'), | |
testMatch: ['**/?(*.)+(test).js'] | |
} |
This file contains 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 = { | |
roots: [ | |
'<rootDir>/dist/', | |
], | |
testEnvironment: 'node', | |
transform: { | |
'^.+\\.(ts|tsx)$': 'ts-jest', | |
}, | |
testMatch: ['**/?(*.)+(spec|test).js'] | |
} |
This file contains 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 = { | |
...require('./jest.config'), | |
testMatch: ['**/?(*.)+(spec).js'] | |
} |
This file contains 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
{ | |
... | |
"scripts": { | |
... | |
"build": "rm -rf dist && tsc", | |
"prespec": "yarn build", | |
"spec": "yarn jest --config jest.config.spec.only.js --passWithNoTests", | |
"preintegration": "yarn build", | |
"integration": "yarn jest --config jest.config.integration.only.js --passWithNoTests", | |
"pretest": "yarn build", | |
"test": "yarn jest --passWithNoTests" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment