Skip to content

Commit

Permalink
Use jest specific typescript config
Browse files Browse the repository at this point in the history
  • Loading branch information
Flufd committed Sep 10, 2019
1 parent 8224577 commit 750780d
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module.exports = {
roots: ["<rootDir>/src"],
globals: {
'ts-jest': {
tsConfig: 'tsconfig.json'
tsConfig: 'tsconfig.jest.json'
}
},
transform: {
Expand Down
5 changes: 0 additions & 5 deletions src/useCurrentEffect.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,6 @@ describe("useCurrentEffect", () => {
expect(testCleanup).toHaveBeenCalledTimes(2);
});

const delay = async (ms: number) =>
new Promise((resolve: TimerHandler, reject: any) => {
setTimeout(resolve, ms);
});

it("Sets isCurrent result to false when the dependencies change", async () => {
const spy = jest.fn();

Expand Down
6 changes: 1 addition & 5 deletions tsconfig.jest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"declaration": true,
"declarationDir": "./dist",
"outDir": "./dist",
"lib": ["es2015","dom"],
"lib": ["es2015", "dom"],
"jsx": "react"
},
"include": ["src/**/*"],
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"declaration": true,
"declarationDir": "./dist",
"outDir": "./dist",
"lib": ["es2015","dom"],
"jsx": "react"
"lib": ["es2015"]
},
"include": ["src/**/*"],
"exclude": ["./node_modules/**/*", "src/**/*.test.tsx"]
Expand Down

0 comments on commit 750780d

Please sign in to comment.