File tree Expand file tree Collapse file tree 5 files changed +19
-5
lines changed
utils/notifications/handlers Expand file tree Collapse file tree 5 files changed +19
-5
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,11 @@ pnpm install
1818> OAUTH_CLIENT_ID=" 123" OAUTH_CLIENT_SECRET=" 456789" pnpm build
1919> ` ` `
2020
21+ Copy the ` .env.template` to ` .env` and add update ` GITHUB_TOKEN` with a GitHub Personal Access Token. This is used for fetching the latest GitHub GraphQL API schema for ` graphql-codegen` .
22+ ` ` ` shell
23+ GITHUB_TOKEN=< some personal access token>
24+ ```
25+
2126To watch for changes (` webpack ` ) in the ` src ` directory:
2227
2328``` shell
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import type { Config } from 'jest';
22
33const config : Config = {
44 preset : 'ts-jest' ,
5+ globalSetup : '<rootDir>/src/renderer/__helpers__/jest.setup.env.ts' ,
56 setupFilesAfterEnv : [ '<rootDir>/src/renderer/__helpers__/jest.setup.ts' ] ,
67 testEnvironment : 'jsdom' ,
78 collectCoverage : true ,
Original file line number Diff line number Diff line change 1+ /**
2+ * Jest Global Setup
3+ * This runs once before all test suites
4+ */
5+ export default ( ) => {
6+ // Sets timezone to UTC for consistent date/time in tests and snapshots
7+ process . env . TZ = 'UTC' ;
8+
9+ // Mock OAuth client ID and secret
10+ process . env . OAUTH_CLIENT_ID = 'FAKE_CLIENT_ID_123' ;
11+ process . env . OAUTH_CLIENT_SECRET = 'FAKE_CLIENT_SECRET_123' ;
12+ } ;
Original file line number Diff line number Diff line change @@ -45,10 +45,6 @@ window.gitify = {
4545 raiseNativeNotification : jest . fn ( ) ,
4646} ;
4747
48- // Mock OAuth client ID and secret
49- process . env . OAUTH_CLIENT_ID = 'FAKE_CLIENT_ID_123' ;
50- process . env . OAUTH_CLIENT_SECRET = 'FAKE_CLIENT_SECRET_123' ;
51-
5248globalThis . HTMLMediaElement . prototype . play = jest . fn ( ) ;
5349
5450globalThis . matchMedia = ( query : string ) : MediaQueryList => ( {
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ class IssueHandler extends DefaultHandler {
5353
5454 return {
5555 number : issue . number ,
56- state : issue . state_reason ?? issue . state ,
56+ state : issueState ,
5757 user : getSubjectUser ( [ issueCommentUser , issue . user ] ) ,
5858 comments : issue . comments ,
5959 labels : issue . labels ?. map ( ( label ) => label . name ) ?? [ ] ,
You can’t perform that action at this time.
0 commit comments