Skip to content

Commit 3fb49b3

Browse files
committed
Fix Tests
1 parent 49a5599 commit 3fb49b3

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
"homepage": "https://www.gitify.io/",
5151
"jest": {
5252
"preset": "ts-jest/presets/js-with-ts",
53+
"setupFiles": [
54+
"<rootDir>/src/js/__helpers__/setupEnvVars.js"
55+
],
5356
"testEnvironment": "jsdom",
5457
"coverageThreshold": {
5558
"global": {

src/js/__helpers__/setupEnvVars.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
process.env.OAUTH_CLIENT_ID = 'FAKE_CLIENT_ID_123';
2+
process.env.OAUTH_CLIENT_SECRET = 'FAKE_CLIENT_SECRET_123';

src/js/utils/helpers.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ describe('utils/helpers.ts', () => {
111111

112112
expect(new BrowserWindow().loadURL).toHaveBeenCalledTimes(1);
113113
expect(new BrowserWindow().loadURL).toHaveBeenCalledWith(
114-
'https://github.com/login/oauth/authorize?client_id=3fef4433a29c6ad8f22c&scope=user:email,notifications'
114+
'https://github.com/login/oauth/authorize?client_id=FAKE_CLIENT_ID_123&scope=user:email,notifications'
115115
);
116116

117117
expect(new BrowserWindow().destroy).toHaveBeenCalledTimes(1);
@@ -171,7 +171,7 @@ describe('utils/helpers.ts', () => {
171171

172172
expect(new BrowserWindow().loadURL).toHaveBeenCalledTimes(1);
173173
expect(new BrowserWindow().loadURL).toHaveBeenCalledWith(
174-
'https://github.com/login/oauth/authorize?client_id=3fef4433a29c6ad8f22c&scope=user:email,notifications'
174+
'https://github.com/login/oauth/authorize?client_id=FAKE_CLIENT_ID_123&scope=user:email,notifications'
175175
);
176176

177177
expect(new BrowserWindow().destroy).toHaveBeenCalledTimes(1);

0 commit comments

Comments
 (0)