Created
September 12, 2018 16:37
-
-
Save admhpr/37b7743bc0b3a012bbb35279726abfd9 to your computer and use it in GitHub Desktop.
Jest Enzyme and Typescript
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
/* | |
* Add to __tests__/setup/ | |
*/ | |
import { configure } from 'enzyme'; | |
import Adapter from 'enzyme-adapter-react-16'; | |
configure({ adapter: new Adapter() }) |
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 = { | |
transform: { | |
'^.+\\.tsx?$': 'ts-jest', | |
}, | |
setupFiles: ['<rootDir>/src/__tests__/setup/enzyme.ts'], | |
testRegex: '(/__tests__/^/(?!setup$).*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$', | |
testPathIgnorePatterns: [ | |
'<rootDir>/node_modules/', | |
'<rootDir>/docker_node_modules/', | |
'<rootDir>src/__tests__/setup/', | |
], | |
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], | |
}; |
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
Show hidden characters
/** | |
* ts ❤ ⚛️ | |
*/ | |
{ | |
"compilerOptions": { | |
"allowJs": true, | |
"allowSyntheticDefaultImports": true, | |
"allowUnreachableCode": false, | |
"baseUrl": ".", | |
"esModuleInterop": true, | |
"forceConsistentCasingInFileNames": true, | |
"jsx": "react", | |
"lib": [ | |
"dom", | |
"es6" | |
], | |
"module": "esnext", | |
"moduleResolution": "node", | |
"noImplicitReturns": true, | |
"noImplicitThis": true, | |
"noImplicitAny": true, | |
"skipLibCheck": true, | |
"noUnusedLocals": true, | |
"outDir": "dist/", | |
"paths": { | |
"@core/*": ["src/core/*"], | |
"@data/*": ["src/data/*"], | |
"@pages/*": ["src/pages/*"], | |
"@interfaces/*": ["src/interfaces/*"], | |
"@layouts/*": ["src/core/layouts/*"], | |
"@processes/*": ["src/processes/*"], | |
"@redux/*": ["src/redux/*"], | |
"@router/*": ["src/core/router/*"], | |
"@tasks/*": ["src/tasks/*"], | |
"@users/*": ["src/core/users/*"], | |
"@utils/*": ["src/core/utils/*"], | |
"@widgets/*": ["src/widgets/*"] | |
}, | |
"preserveConstEnums": true, | |
"removeComments": true, | |
"sourceMap": true, | |
"strictNullChecks": true, | |
"suppressImplicitAnyIndexErrors": true, | |
"target": "es5", | |
"types": [ | |
"webpack-env" | |
] | |
}, | |
"exclude": ["node_modules", "dist", "**/__tests__/*"], | |
"include": ["./src/**/*"] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment