Skip to content

Commit

Permalink
Integrate ts-jest with jest
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Jan 12, 2018
1 parent 6c26c31 commit 4976120
Show file tree
Hide file tree
Showing 4 changed files with 410 additions and 19 deletions.
12 changes: 8 additions & 4 deletions server/zanata-frontend/src/frontend/jest.config.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"collectCoverageFrom": [
"app/**/*.{js,jsx}",
"app/**/*.{js,jsx,ts,tsx}",
"!**/node_modules/**",
"!app/**/*.story.js"
"!app/**/*.story.{js,ts}",
"!dist"
],
"coverageReporters": [
"cobertura",
Expand All @@ -14,7 +15,7 @@
"\\.(css|less)$": "<rootDir>/__mocks__/cssMock.js"
},
"transform": {
".*": "./node_modules/babel-jest"
"^.+\\.(jsx?|tsx?)$": "ts-jest"
},
"testPathIgnorePatterns": [
"/node_modules/",
Expand All @@ -24,9 +25,12 @@
"/node_modules",
"/app"
],
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$",
"moduleFileExtensions": [
"js",
"jsx",
"json"
"json",
"ts",
"tsx"
]
}
3 changes: 2 additions & 1 deletion server/zanata-frontend/src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"source-map-loader": "^0.2.3",
"storybook-host": "3.0.0",
"style-loader": "0.13.1",
"ts-jest": "^22.0.1",
"typescript": "^2.6.2",
"webpack": "3.4.1",
"webpack-dev-server": "2.6.1",
Expand All @@ -85,7 +86,7 @@
},
"dependencies": {
"@types/intl-messageformat": "^1.3.0",
"@types/jest": "^21.1.8",
"@types/jest": "21.1.10",
"@types/lodash": "^4.14.91",
"@types/prop-types": "^15.5.2",
"@types/react": "^16.0.31",
Expand Down
2 changes: 1 addition & 1 deletion server/zanata-frontend/src/frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// https://github.com/Microsoft/TypeScript-React-Starter/issues/8
"allowSyntheticDefaultImports": true,
"checkJs": false,
"jsx": "react-native",
"jsx": "react",
"module": "commonjs",
"outDir": "./dist/",
// TODO fix sourcemap problems with intl-messageformat
Expand Down
Loading

0 comments on commit 4976120

Please sign in to comment.