Skip to content

Commit

Permalink
Merge pull request #20 from anaswaratrajan/jest
Browse files Browse the repository at this point in the history
Jest setup
  • Loading branch information
anastr0 authored Jan 8, 2021
2 parents 0bc766a + ee4eb68 commit fb2b37b
Show file tree
Hide file tree
Showing 8 changed files with 8,594 additions and 3,125 deletions.
2 changes: 2 additions & 0 deletions enzyme.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
const Adapter = require('enzyme-adapter-react-16')
require('enzyme').configure({ adapter: new Adapter() })
35 changes: 35 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
moduleFileExtensions: [
"ts",
"tsx",
"js"
],
transform: {
"^.+\\.tsx?$": "ts-jest"
},
testMatch: [
"**/*.(test|spec).(ts|tsx)"
],
globals: {
"ts-jest": {
babelConfig: true,
tsConfig: "jest.tsconfig.json",
diagnostics: false
}
},
coveragePathIgnorePatterns: [
"/node_modules/",
"enzyme.js"
],
setupFilesAfterEnv: ["<rootDir>/enzyme.js"],
coverageReporters: [
"json",
"lcov",
"text",
"text-summary"
],
moduleNameMapper: {
"\\.(css|less|sass|scss)$": "<rootDir>/__mocks__/styleMock.js",
"\\.(gif|ttf|eot|svg)$": "<rootDir>/__mocks__/fileMock.js"
}
};
24 changes: 24 additions & 0 deletions jest.tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "esnext",
"jsx": "react",
"sourceMap": false,
"experimentalDecorators": true,
"noImplicitUseStrict": true,
"removeComments": true,
"moduleResolution": "node",
"lib": [
"es2017",
"dom"
],
"typeRoots": [
"node_modules/@types"
]
},
"exclude": [
"node_modules",
"out",
".next"
]
}
Loading

0 comments on commit fb2b37b

Please sign in to comment.