File tree 3 files changed +22
-12
lines changed
3 files changed +22
-12
lines changed Original file line number Diff line number Diff line change
1
+ const config = {
2
+ "preset" : "ts-jest/presets/js-with-ts" ,
3
+ "setupFiles" : [
4
+ "<rootDir>/src/__helpers__/setupEnvVars.js"
5
+ ] ,
6
+ "testEnvironment" : "jsdom" ,
7
+ "coverageThreshold" : {
8
+ "global" : {
9
+ "lines" : 90
10
+ }
11
+ } ,
12
+ "transformIgnorePatterns" : [ "node_modules\/(?!axios)" ] ,
13
+ "moduleNameMapper" : {
14
+ // Force CommonJS build for http adapter to be available.
15
+ // via https://github.com/axios/axios/issues/5101#issuecomment-1276572468
16
+ '^axios$' : require . resolve ( 'axios' ) ,
17
+ } ,
18
+ }
19
+
20
+ module . exports = config ;
Original file line number Diff line number Diff line change 48
48
"url" : " https://github.com/manosim/gitify/issues"
49
49
},
50
50
"homepage" : " https://www.gitify.io/" ,
51
- "jest" : {
52
- "preset" : " ts-jest/presets/js-with-ts" ,
53
- "setupFiles" : [
54
- " <rootDir>/src/__helpers__/setupEnvVars.js"
55
- ],
56
- "testEnvironment" : " jsdom" ,
57
- "coverageThreshold" : {
58
- "global" : {
59
- "lines" : 90
60
- }
61
- }
62
- },
63
51
"build" : {
64
52
"appId" : " com.electron.gitify" ,
65
53
"productName" : " Gitify" ,
Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ import { mockedUser } from '../__mocks__/mockedData';
9
9
10
10
describe ( 'hooks/useNotifications.ts' , ( ) => {
11
11
beforeEach ( ( ) => {
12
+ // axios will default to using the XHR adapter which can't be intercepted
13
+ // by nock. So, configure axios to use the node adapter.
12
14
axios . defaults . adapter = 'http' ;
13
15
} ) ;
14
16
You can’t perform that action at this time.
0 commit comments