Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const config = {
"preset": "ts-jest/presets/js-with-ts",
"setupFiles": [
"<rootDir>/src/__helpers__/setupEnvVars.js"
],
"testEnvironment": "jsdom",
"coverageThreshold": {
"global": {
"lines": 90
}
},
"moduleNameMapper": {
// Force CommonJS build for http adapter to be available.
// via https://github.com/axios/axios/issues/5101#issuecomment-1276572468
'^axios$': require.resolve('axios'),
},
}

module.exports = config;
14 changes: 1 addition & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,6 @@
"url": "https://github.com/manosim/gitify/issues"
},
"homepage": "https://www.gitify.io/",
"jest": {
"preset": "ts-jest/presets/js-with-ts",
"setupFiles": [
"<rootDir>/src/__helpers__/setupEnvVars.js"
],
"testEnvironment": "jsdom",
"coverageThreshold": {
"global": {
"lines": 90
}
}
},
"build": {
"appId": "com.electron.gitify",
"productName": "Gitify",
Expand Down Expand Up @@ -106,7 +94,7 @@
},
"dependencies": {
"@primer/octicons-react": "19.8.0",
"axios": "0.27.2",
"axios": "1.5.1",
"date-fns": "2.30.0",
"electron-updater": "6.1.4",
"final-form": "4.20.10",
Expand Down
13 changes: 9 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/hooks/useNotifications.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import { mockedUser } from '../__mocks__/mockedData';

describe('hooks/useNotifications.ts', () => {
beforeEach(() => {
axios.defaults.adapter = require('axios/lib/adapters/http');
// axios will default to using the XHR adapter which can't be intercepted
// by nock. So, configure axios to use the node adapter.
axios.defaults.adapter = 'http';
});

describe('fetchNotifications', () => {
Expand Down