Skip to content

Commit 7b577c7

Browse files
committed
Merge branch 'master' into leaderboard
2 parents 704ba6c + 444bf19 commit 7b577c7

File tree

137 files changed

+2796
-3167
lines changed

Some content is hidden

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

137 files changed

+2796
-3167
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
runs-on: ubuntu-latest
2323
strategy:
2424
matrix:
25-
commands: [tsc, 'format:ci', eslint, build, test, test-coveralls]
25+
commands: [tsc, 'format:ci', eslint, build, 'test --bail=1', test-coveralls]
2626
steps:
2727
- name: Checkout repository
2828
uses: actions/checkout@v4
@@ -43,5 +43,5 @@ jobs:
4343
if: matrix.commands == 'test-coveralls'
4444
uses: coverallsapp/github-action@master
4545
with:
46-
path-to-lcov: lcov.info
46+
path-to-lcov: coverage/lcov.info
4747
github-token: ${{ secrets.GITHUB_TOKEN }}

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ To start contributing, create a fork from our repo and send a PR. Refer to [this
1616

1717
The frontend comes with an extensive test suite. To run the tests after you made your modifications, run
1818
`yarn test`. Regression tests are run automatically when you want to push changes to this repository.
19-
The regression tests are generated using `jest` and stored as snapshots in `src/\_\_tests\_\_`. After modifying the frontend, carefully inspect any failing regression tests reported in red in the command line. If you are convinced that the regression tests and not your changes are at fault, you can update the regression tests by running:
19+
The regression tests are generated using `vitest` and stored as snapshots in `src/\_\_tests\_\_`. After modifying the frontend, carefully inspect any failing regression tests reported in red in the command line. If you are convinced that the regression tests and not your changes are at fault, you can update the regression tests by running:
2020

2121
```bash
22-
yarn test --updateSnapshot
22+
yarn test --update
2323
```
2424

2525
## Manually testing the frontend

jest.config.js

Lines changed: 0 additions & 104 deletions
This file was deleted.

jsdom-env.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

package.json

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,22 @@
2121
"format:scss": "prettier --list-different --parser scss \"src/**/*.scss\"",
2222
"format:ci": "yarn run format:tsx && yarn run format:scss",
2323
"start": "rsbuild dev",
24-
"test": "cross-env TZ=Asia/Singapore jest",
24+
"test": "cross-env TZ=Asia/Singapore vitest run",
25+
"test:watch": "cross-env TZ=Asia/Singapore vitest",
26+
"test:ui": "cross-env TZ=Asia/Singapore vitest --ui --no-open",
2527
"test-coveralls": "./scripts/test-coveralls.sh",
26-
"update-ui-snapshots": "jest --updateSnapshot",
28+
"update-ui-snapshots": "vitest run --update",
2729
"eslint": "eslint src",
2830
"prepare": "husky",
2931
"preview": "rsbuild preview"
3032
},
3133
"dependencies": {
3234
"@blueprintjs/core": "^5.10.1",
3335
"@blueprintjs/datetime2": "^2.3.3",
34-
"@blueprintjs/icons": "^5.9.0",
36+
"@blueprintjs/icons": "^6.0.0",
3537
"@blueprintjs/select": "^5.1.3",
3638
"@mantine/hooks": "^7.11.2",
37-
"@octokit/rest": "^20.0.0",
39+
"@octokit/rest": "^22.0.0",
3840
"@reduxjs/toolkit": "^1.9.7",
3941
"@sentry/browser": "^8.33.0",
4042
"@sourceacademy/c-slang": "^1.0.21",
@@ -69,7 +71,7 @@
6971
"mdast-util-from-markdown": "^2.0.0",
7072
"mdast-util-to-hast": "^13.0.0",
7173
"normalize.css": "^8.0.1",
72-
"phaser": "~3.87.0",
74+
"phaser": "~3.90.0",
7375
"query-string": "^9.0.0",
7476
"re-resizable": "^6.9.9",
7577
"react": "^18.3.1",
@@ -122,7 +124,6 @@
122124
"@rsbuild/plugin-svgr": "^1.2.0",
123125
"@svgr/webpack": "^8.0.0",
124126
"@swc/core": "^1.11.22",
125-
"@swc/jest": "^0.2.38",
126127
"@testing-library/dom": "^10.4.0",
127128
"@testing-library/jest-dom": "^6.0.0",
128129
"@testing-library/react": "^16.0.0",
@@ -134,7 +135,6 @@
134135
"@types/gapi.client.drive-v3": "^0.0.5",
135136
"@types/google.picker": "^0.0.51",
136137
"@types/identity-obj-proxy": "^3",
137-
"@types/jest": "^29.0.0",
138138
"@types/js-cookie": "^3.0.6",
139139
"@types/js-yaml": "^4.0.5",
140140
"@types/lodash": "^4.14.195",
@@ -147,7 +147,9 @@
147147
"@types/redux-mock-store": "^1.0.3",
148148
"@types/showdown": "^2.0.1",
149149
"@types/xml2js": "^0.4.11",
150-
"babel-jest": "^29.7.0",
150+
"@vitejs/plugin-react-swc": "^3.11.0",
151+
"@vitest/coverage-v8": "3.2.4",
152+
"@vitest/ui": "^3.2.4",
151153
"buffer": "^6.0.3",
152154
"canvas": "^3.1.0",
153155
"constants-browserify": "^1.0.0",
@@ -161,8 +163,7 @@
161163
"https-browserify": "^1.0.0",
162164
"husky": "^9.0.0",
163165
"identity-obj-proxy": "^3.0.0",
164-
"jest": "^29.7.0",
165-
"jest-environment-jsdom": "^29.7.0",
166+
"jsdom": "^25.0.1",
166167
"npm-run-all2": "^8.0.0",
167168
"os-browserify": "^0.3.0",
168169
"path": "^0.12.7",
@@ -181,6 +182,7 @@
181182
"typescript": "^5.8.2",
182183
"typescript-eslint": "^8.1.0",
183184
"url": "^0.11.1",
185+
"vitest": "^3.2.4",
184186
"webpack-bundle-analyzer": "^4.9.0"
185187
},
186188
"browserslist": {

renovate.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"packageRules": [
99
{
1010
"rangeStrategy": "update-lockfile",
11-
"matchPackageNames": ["*"]
11+
"matchPackageNames": ["*"],
12+
"minimumReleaseAge": "5 days"
1213
}
1314
],
1415
"enabledManagers": ["npm"]

rsbuild.config.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import { InjectManifest } from '@aaroon/workbox-rspack-plugin';
12
import { defineConfig, loadEnv } from '@rsbuild/core';
23
import { pluginEslint } from '@rsbuild/plugin-eslint';
34
import { pluginNodePolyfill } from '@rsbuild/plugin-node-polyfill';
45
import { pluginReact } from '@rsbuild/plugin-react';
56
import { pluginSass } from '@rsbuild/plugin-sass';
67
import { pluginSvgr } from '@rsbuild/plugin-svgr';
7-
import { InjectManifest } from '@aaroon/workbox-rspack-plugin';
88

99
const { publicVars, rawPublicVars } = loadEnv({ prefixes: ['REACT_APP_'] });
1010

@@ -91,13 +91,15 @@ export default defineConfig({
9191
(warning: any) => {
9292
// Ignore the warnings that occur because js-slang uses dynamic imports
9393
// to load Source modules
94-
const moduleName = warning.moduleDescriptor?.name
95-
if (!moduleName) return false
94+
const moduleName = warning.moduleDescriptor?.name;
95+
if (!moduleName) return false;
9696

97-
if (!/js-slang\/dist\/modules\/loader\/loaders.js/.test(moduleName)) return false
98-
return /Critical dependency: the request of a dependency is an expression/.test(warning.message)
97+
if (!/js-slang\/dist\/modules\/loader\/loaders.js/.test(moduleName)) return false;
98+
return /Critical dependency: the request of a dependency is an expression/.test(
99+
warning.message
100+
);
99101
}
100-
102+
101103
// {
102104
// // Ignore warnings for dependencies that do not ship with a source map.
103105
// // This is because we cannot do anything about our dependencies.
@@ -124,7 +126,7 @@ export default defineConfig({
124126
new InjectManifest({
125127
swSrc: './src/service-worker.ts',
126128
swDest: 'service-worker.js',
127-
maximumFileSizeToCacheInBytes: 20 * 1024 * 1024,
129+
maximumFileSizeToCacheInBytes: 20 * 1024 * 1024
128130
})
129131
];
130132

scripts/test-coveralls.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
set -euo pipefail
44

55
./scripts/coverage-fix.sh do && \
6-
yarn test --coverage --coverageReporters=text-lcov \
7-
--collectCoverageFrom='!**/src/features/game/**' > lcov.info
6+
yarn test --coverage --coverage.reporter=lcov \
7+
--coverage.exclude='**/src/features/game/**'
File renamed without changes.

0 commit comments

Comments
 (0)