Skip to content

Instantly share code, notes, and snippets.

@Roms1383
Created January 16, 2020 03:40
Show Gist options
  • Save Roms1383/3a00334fcc70b10ecdadd97a8f4fbf05 to your computer and use it in GitHub Desktop.
Save Roms1383/3a00334fcc70b10ecdadd97a8f4fbf05 to your computer and use it in GitHub Desktop.
Medium - Dynamically matching files in Jest - using CLI regexp
module.exports = {
roots: [
'<rootDir>/dist/',
],
testEnvironment: 'node',
transform: {
'^.+\\.(ts|tsx)$': 'ts-jest',
},
}
{
...
"scripts": {
...
"build": "rm -rf dist && tsc",
"prespec": "yarn build",
"spec": "yarn jest \"^(.*\/)*(.*\\.)*(spec)\\.js$\" --passWithNoTests",
"preintegration": "yarn build",
"integration": "yarn jest \"^(.*\/)*(.*\\.)*(test)\\.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