Skip to content

Commit aa3eae9

Browse files
committed
refactor: notification handlers
Signed-off-by: Adam Setch <[email protected]>
1 parent cd71598 commit aa3eae9

File tree

3 files changed

+7
-35
lines changed

3 files changed

+7
-35
lines changed

src/renderer/__helpers__/jest.setup.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@ import { TextDecoder, TextEncoder } from 'node:util';
33

44
import axios from 'axios';
55

6+
/**
7+
* axios will default to using the XHR adapter which can't be intercepted
8+
* by nock. So, configure axios to use the node adapter.
9+
*/
10+
axios.defaults.adapter = 'http';
11+
12+
613
/**
714
* Prevent the following errors with jest:
815
* - ReferenceError: TextEncoder is not defined
@@ -37,7 +44,3 @@ global.ResizeObserver = class {
3744
unobserve() {}
3845
disconnect() {}
3946
};
40-
41-
// axios will default to using the XHR adapter which can't be intercepted
42-
// by nock. So, configure axios to use the node adapter.
43-
axios.defaults.adapter = 'http';

src/renderer/components/settings/__snapshots__/SettingsFooter.test.tsx.snap

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

src/renderer/utils/auth/utils.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ipcRenderer } from 'electron';
22

33
import type { AxiosPromise, AxiosResponse } from 'axios';
4-
import axios from 'axios';
54
import nock from 'nock';
65

76
import {
@@ -169,10 +168,6 @@ describe('renderer/utils/auth/utils.ts', () => {
169168
mockAuthState = {
170169
accounts: [],
171170
};
172-
173-
// axios will default to using the XHR adapter which can't be intercepted
174-
// by nock. So, configure axios to use the node adapter.
175-
axios.defaults.adapter = 'http';
176171
});
177172

178173
describe('should add GitHub Cloud account', () => {

0 commit comments

Comments
 (0)