-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
overhaul tests to typescript, update ts configs
- Loading branch information
Emil Hartz
committed
Jul 14, 2020
1 parent
cdf5d93
commit 83ef4d2
Showing
12 changed files
with
283 additions
and
104 deletions.
There are no files selected for viewing
This file contains 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
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {MockedSwipeFunctions} from '../useSwipeable.spec'; | ||
|
||
const expectSwipingDir = (fns: jest.Mock, dir: string) => { | ||
fns.mock.calls.forEach((call) => { | ||
expect(call[0].dir).toBe(dir); | ||
}); | ||
}; | ||
|
||
export const expectSwipeFuncsDir = (sf: MockedSwipeFunctions, dir: string): void => { | ||
Object.keys(sf).forEach((s) => { | ||
if (s.endsWith(dir) || s === "onSwiped") { | ||
expect(sf[s as keyof MockedSwipeFunctions]).toHaveBeenCalled(); | ||
} else if (s === "onSwiping") { | ||
expectSwipingDir(sf[s], dir); | ||
} else { | ||
expect(sf[s as keyof MockedSwipeFunctions]).not.toHaveBeenCalled(); | ||
} | ||
}); | ||
} |
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "./tsconfig.base.json", | ||
"include": ["src/**/*", "__tests__"], | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"baseUrl": ".", | ||
"esModuleInterop": true, | ||
"jsx": "react", | ||
"lib": ["ESNext", "dom"], | ||
"module": "ESNext", | ||
"moduleResolution": "node", | ||
"noImplicitAny": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"outDir": "lib/", | ||
"pretty": true, | ||
"rootDirs": ["./src", "./stories"], | ||
"skipLibCheck": true, | ||
"sourceMap": true, | ||
"strict": true, | ||
"target": "ESNext" | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,4 @@ | ||
{ | ||
"compilerOptions": { | ||
"allowJs": true, | ||
"baseUrl": ".", | ||
"esModuleInterop": true, | ||
"jsx": "react", | ||
"lib": ["esnext", "dom"], | ||
"module": "es2015", | ||
"moduleResolution": "node", | ||
"noImplicitAny": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"outDir": "lib/", | ||
"pretty": true, | ||
"rootDirs": ["./src", "./stories"], | ||
"skipLibCheck": true, | ||
"sourceMap": true, | ||
"strict": true, | ||
"target": "esnext" | ||
}, | ||
"extends": "./tsconfig.base.json", | ||
"include": ["src/**/*"], | ||
"exclude": ["examples/**/*"] | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "./tsconfig.base.json", | ||
"include": ["__tests__"], | ||
} |
Oops, something went wrong.