Skip to content

Commit 2a13750

Browse files
renovate[bot]Brendan Mulholland
andauthored
fix(deps): update dependency axios to v1 (#613)
* fix(deps): update dependency axios to v1 * Use new adapter setting See axios/axios#5277 * Fix tests * Remove unnecessary transform --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Brendan Mulholland <[email protected]>
1 parent d52fd2d commit 2a13750

File tree

4 files changed

+32
-18
lines changed

4 files changed

+32
-18
lines changed

jest.config.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
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+
"moduleNameMapper": {
13+
// Force CommonJS build for http adapter to be available.
14+
// via https://github.com/axios/axios/issues/5101#issuecomment-1276572468
15+
'^axios$': require.resolve('axios'),
16+
},
17+
}
18+
19+
module.exports = config;

package.json

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,6 @@
4848
"url": "https://github.com/manosim/gitify/issues"
4949
},
5050
"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-
},
6351
"build": {
6452
"appId": "com.electron.gitify",
6553
"productName": "Gitify",
@@ -106,7 +94,7 @@
10694
},
10795
"dependencies": {
10896
"@primer/octicons-react": "19.8.0",
109-
"axios": "0.27.2",
97+
"axios": "1.5.1",
11098
"date-fns": "2.30.0",
11199
"electron-updater": "6.1.4",
112100
"final-form": "4.20.10",

pnpm-lock.yaml

Lines changed: 9 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/hooks/useNotifications.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ import { mockedUser } from '../__mocks__/mockedData';
99

1010
describe('hooks/useNotifications.ts', () => {
1111
beforeEach(() => {
12-
axios.defaults.adapter = require('axios/lib/adapters/http');
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.
14+
axios.defaults.adapter = 'http';
1315
});
1416

1517
describe('fetchNotifications', () => {

0 commit comments

Comments
 (0)