Skip to content
This repository has been archived by the owner on Jan 26, 2020. It is now read-only.

Commit

Permalink
added jest config for typescript testing
Browse files Browse the repository at this point in the history
  • Loading branch information
alidcast committed Jul 26, 2018
1 parent ae7d214 commit 69708c4
Show file tree
Hide file tree
Showing 4 changed files with 551 additions and 15 deletions.
14 changes: 14 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module.exports = {
verbose: true,
testEnvironment: "node",
moduleFileExtensions: ['js', 'ts', 'tsx'],
testRegex: '.*/__test__/.*.spec.(js|ts|tsx)?$',
transform: {
'^.+\\.tsx?$': 'ts-jest'
},
globals: {
'ts-jest': {
skipBabel: true
}
}
}
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@
"test": "jest"
},
"devDependencies": {
"@types/jest": "^23.3.0",
"babel-jest": "^23.2.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"jest": "^23.2.0",
"lerna": "^2.11.0",
"react-test-renderer": "^16.4.1"
"react-test-renderer": "^16.4.1",
"ts-jest": "^23.0.1"
},
"dependencies": {
"typescript": "^2.9.2"
}
}
15 changes: 15 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"forceConsistentCasingInFileNames": true,
"experimentalDecorators": true,
"removeComments": false,
"preserveConstEnums": true,
"sourceMap": true,
"noImplicitAny": false,
"pretty": true,
"jsx": "react",
"target": "es2015",
"module": "commonjs"
}
}
Loading

0 comments on commit 69708c4

Please sign in to comment.