Skip to content

Commit

Permalink
fix(deps): update dependency react-router-dom to v7 (#1643)
Browse files Browse the repository at this point in the history
* fix(deps): update dependency react-router-dom to v7

* fix textencoder error

Signed-off-by: Adam Setch <adam.setch@outlook.com>

* Update jest.setup.ts

* Update jest.setup.ts

* Update jest.setup.ts

---------

Signed-off-by: Adam Setch <adam.setch@outlook.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Adam Setch <adam.setch@outlook.com>
  • Loading branch information
renovate[bot] and setchy authored Dec 15, 2024
1 parent 3d6b2ba commit 1f8ef91
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 26 deletions.
2 changes: 1 addition & 1 deletion jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { Config } from 'jest';

const config: Config = {
preset: 'ts-jest',
setupFiles: ['<rootDir>/src/renderer/__helpers__/setupEnvVars.js'],
setupFiles: ['<rootDir>/src/renderer/__helpers__/jest.setup.ts'],
testEnvironment: 'jsdom',
collectCoverage: true,
collectCoverageFrom: ['src/**/*', '!**/__snapshots__/**'],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"menubar": "9.5.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-router-dom": "6.28.0",
"react-router-dom": "7.0.2",
"update-electron-app": "3.1.0"
},
"devDependencies": {
Expand Down
67 changes: 45 additions & 22 deletions pnpm-lock.yaml

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

11 changes: 11 additions & 0 deletions src/renderer/__helpers__/jest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { TextDecoder, TextEncoder } from 'node:util';

// Prevent "ReferenceError: TextEncoder is not defined" or "ReferenceError: TextDecoder is not defined" errors
if (!global.TextEncoder || !global.TextDecoder) {
global.TextEncoder = TextEncoder;
global.TextDecoder = TextDecoder;
}

// Mock OAuth client ID and secret
process.env.OAUTH_CLIENT_ID = 'FAKE_CLIENT_ID_123';
process.env.OAUTH_CLIENT_SECRET = 'FAKE_CLIENT_SECRET_123';
2 changes: 0 additions & 2 deletions src/renderer/__helpers__/setupEnvVars.js

This file was deleted.

0 comments on commit 1f8ef91

Please sign in to comment.