Skip to content

Commit 982dadc

Browse files
committed
Merge branch 'master' into hotfix/about-us-horizontal
2 parents 500dee3 + 93065ac commit 982dadc

File tree

61 files changed

+1198
-1096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1198
-1096
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
REACT_APP_API_VERSION=v3.16.7
1+
REACT_APP_API_VERSION=v3.16.8

.github/workflows/cypress.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,5 @@ jobs:
8484
run: |
8585
echo '## 👀 Visual Regression Test updates' >> $GITHUB_STEP_SUMMARY
8686
echo 'This run failed due to visual differences compared to our baseline images. A PR with new baseline images has been generated. Please review it [here](${{ steps.cypress-create-pr.outputs.result }}) and merge it if the differences are expected.' >> $GITHUB_STEP_SUMMARY
87+
echo 'See [this wiki page](https://github.com/isaacphysics/isaac-wiki/wiki/Visual-regression-tests) for more information and troubleshooting steps.' >> $GITHUB_STEP_SUMMARY
8788

config/jest/jest.config.common.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ module.exports = {
44
"!src/**/*.d.ts"
55
],
66
"resolver": "jest-pnp-resolver",
7+
setupFiles: [
8+
"<rootDir>/config/jest/jest.polyfills.js"
9+
],
710
"setupFilesAfterEnv": [
811
"<rootDir>src/test/setupTests.ts",
912
"react-app-polyfill/jsdom"
@@ -15,6 +18,7 @@ module.exports = {
1518
"testEnvironment": "jsdom",
1619
"testEnvironmentOptions": {
1720
"url": "http://localhost",
21+
customExportConditions: [''],
1822
},
1923
"transform": {
2024
"^.+\\.css$": "<rootDir>config/jest/cssTransform.js",
@@ -27,7 +31,8 @@ module.exports = {
2731
],
2832
"moduleNameMapper": {
2933
"^react-native$": "react-native-web",
30-
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
34+
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy",
35+
"uuid": "uuid"
3136
},
3237
"moduleFileExtensions": [
3338
"web.js",

config/jest/jest.polyfills.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// jest.polyfills.js
2+
/**
3+
* @note The block below contains polyfills for Node.js globals
4+
* required for Jest to function when running JSDOM tests.
5+
* These HAVE to be require's and HAVE to be in this exact
6+
* order, since "undici" depends on the "TextEncoder" global API.
7+
*
8+
* Consider migrating to a more modern test runner if
9+
* you don't want to deal with this.
10+
*/
11+
12+
import { TextDecoder, TextEncoder } from 'node:util';
13+
import { ReadableStream, TransformStream } from 'node:stream/web';
14+
import { performance } from 'node:perf_hooks';
15+
16+
Object.defineProperties(globalThis, {
17+
TextDecoder: { value: TextDecoder },
18+
TextEncoder: { value: TextEncoder },
19+
ReadableStream: { value: ReadableStream },
20+
TransformStream: { value: TransformStream },
21+
performance: { value: performance, writable: true }, // writeable for jest fake timers
22+
});
23+
24+
import { Blob, File } from 'node:buffer';
25+
import { fetch, Headers, FormData, Request, Response } from 'undici';
26+
27+
Object.defineProperties(globalThis, {
28+
fetch: { value: fetch, writable: true },
29+
Blob: { value: Blob },
30+
File: { value: File },
31+
Headers: { value: Headers },
32+
FormData: { value: FormData },
33+
Request: { value: Request, configurable: true },
34+
Response: { value: Response, configurable: true },
35+
});

cypress/support/commands.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
// }
3737
// }
3838

39-
import {mount, MountOptions} from 'cypress/react';
39+
import {mount, MountOptions} from 'cypress/react18';
4040

4141
// Augment the Cypress namespace to include type definitions for
4242
// your custom command.
@@ -46,7 +46,7 @@ declare global {
4646
// eslint-disable-next-line @typescript-eslint/no-namespace
4747
namespace Cypress {
4848
interface Chainable {
49-
mountWithStoreAndRouter(component: ReactNode, routes: string[], options: MountOptions): Chainable<Element>;
49+
mountWithStoreAndRouter(component: ReactNode, routes: string[], mountOptions?: MountOptions): Chainable<Element>;
5050
}
5151
}
5252
}
@@ -56,14 +56,14 @@ import {Provider} from "react-redux";
5656
import {store} from "../../src/app/state";
5757
import {MemoryRouter} from "react-router";
5858

59-
Cypress.Commands.add('mountWithStoreAndRouter', (component, routes, options) => {
59+
Cypress.Commands.add('mountWithStoreAndRouter', (component, routes, mountOptions) => {
6060
mount(
6161
<Provider store={store}>
6262
<MemoryRouter initialEntries={routes}>
6363
{component}
6464
</MemoryRouter>
6565
</Provider>
66-
, options
66+
, mountOptions
6767
);
6868
});
6969

@@ -75,4 +75,4 @@ if (Cypress.config('isInteractive')) {
7575
Cypress.Commands.add('matchImage', () => {
7676
cy.log('Skipping snapshot 👀');
7777
});
78-
}
78+
}

eslint.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ export default [
3838
"@typescript-eslint/ban-ts-comment": "off",
3939
"@typescript-eslint/explicit-function-return-type": "off",
4040
"@typescript-eslint/no-empty-interface": "warn",
41-
"@typescript-eslint/explicit-module-boundary-types": "off"
41+
"@typescript-eslint/explicit-module-boundary-types": "off",
42+
"react/jsx-no-target-blank": "off", // https://github.com/isaacphysics/isaac-react-app/pull/1134#discussion_r1774839755
4243
},
4344
languageOptions: {
4445
parser: tsParser,

package.json

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "isaac-react-app",
3-
"version": "3.14.1-SNAPSHOT",
3+
"version": "3.14.2-SNAPSHOT",
44
"private": true,
55
"engines": {
66
"node": ">=18",
@@ -50,7 +50,7 @@
5050
"redux": "^4.2.1",
5151
"redux-logger": "^3.0.6",
5252
"remarkable": "^2.0.1",
53-
"uuid": "^9.0.1"
53+
"uuid": "^10.0.0"
5454
},
5555
"scripts": {
5656
"build-phy": "webpack --env prod --config config/webpack.config.physics.js",
@@ -122,7 +122,7 @@
122122
"@types/redux-logger": "^3.0.13",
123123
"@types/redux-mock-store": "^1.0.6",
124124
"@types/remarkable": "^2.0.8",
125-
"@types/uuid": "^9.0.8",
125+
"@types/uuid": "^10.0.0",
126126
"@typescript-eslint/eslint-plugin": "^8.3.0",
127127
"@typescript-eslint/parser": "^8.3.0",
128128
"axios-mock-adapter": "^1.22.0",
@@ -147,7 +147,7 @@
147147
"jest-environment-jsdom": "^29.7.0",
148148
"jest-watch-typeahead": "^2.2.2",
149149
"mini-css-extract-plugin": "^2.9.1",
150-
"msw": "0.49.3",
150+
"msw": "^2.4.9",
151151
"react-app-polyfill": "^3.0.0",
152152
"react-leaflet": "^4.2.1",
153153
"react-remove-props-loader": "^1.2.7",
@@ -161,15 +161,13 @@
161161
"ts-loader": "^9.5.1",
162162
"typescript": "^5.5.4",
163163
"typescript-eslint": "^8.3.0",
164+
"undici": "^6.19.8",
164165
"webpack": "^5.94.0",
165166
"webpack-bundle-analyzer": "^4.10.2",
166167
"webpack-cli": "^5.1.4",
167168
"webpack-dev-server": "^4.15.2"
168169
},
169170
"msw": {
170171
"workerDirectory": "public"
171-
},
172-
"resolutions": {
173-
"headers-polyfill": "3.2.5"
174172
}
175173
}

0 commit comments

Comments
 (0)