Skip to content

Instantly share code, notes, and snippets.

@rochapablo
Created September 5, 2018 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rochapablo/feab6ef190b2176cdd63f274aea2f5e4 to your computer and use it in GitHub Desktop.
Save rochapablo/feab6ef190b2176cdd63f274aea2f5e4 to your computer and use it in GitHub Desktop.
jest
module.exports = {
globals: {
'ts-jest': {
tsConfigFile: 'tsconfig.json'
}
},
moduleFileExtensions: [
'ts',
'js'
],
transform: {
'^.+\\.(ts|tsx)$': './node_modules/ts-jest/preprocessor.js'
},
testMatch: [
'**/test/**/*.test.(ts|js)'
],
testEnvironment: 'node',
setupFiles: [
// "<rootDir>/test/setup.js"
],
setupTestFrameworkScriptFile: '<rootDir>/test/setup.ts'
};
"jest": {
"preset": "react-native",
"setupFiles": [
"<rootDir>/tests/setup.js"
],
"transform": {
"^.+\\.(js|jsx)?$": "<rootDir>/node_modules/babel-jest",
"^.+\\.(ts|tsx)?$": "<rootDir>/node_modules/ts-jest/preprocessor.js"
},
"testRegex": "/tests/src/.*.spec.(js|tsx|ts)?$",
"transformIgnorePatterns": [
"/node_modules/(?!native-base)/"
],
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json"
],
"moduleNameMapper": {
".+\\.(css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "identity-obj-proxy"
}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment