Unit testing the frontend (#7829)

This adds some unit tests for the front end.

- configures "frontend tests" as a unit tests in `static/tests`,
removing the old cypress-requiring "unit" tests
- hack enough of a DOM  to get things working
- port motd and id tests
- *adds* a golden layout checks  (see #7807)
- Updates READMEs etc

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Matt Godbolt
2025-06-19 08:46:57 -05:00
committed by GitHub
parent 02b4aa9f02
commit 23fad10939
20 changed files with 2701 additions and 470 deletions

View File

@@ -111,12 +111,14 @@
"css-minimizer-webpack-plugin": "^7.0.2",
"cypress": "^14.4.1",
"file-loader": "^6.2.0",
"happy-dom": "^18.0.1",
"husky": "^9.1.7",
"lint-staged": "^16.1.0",
"mini-css-extract-plugin": "^2.9.2",
"mock-fs": "^5.5.0",
"monaco-editor-webpack-plugin": "^7.1.0",
"nock": "^14.0.5",
"npm-run-all": "^4.1.5",
"sass": "^1.89.2",
"sass-loader": "^16.0.5",
"source-map-loader": "^5.0.0",
@@ -156,7 +158,11 @@
"update-browserslist": "npx browserslist@latest -- --update-db",
"prepare": "husky",
"ts-compile": "tsc",
"ts-check": "tsc -p ./tsconfig.backend.json --noEmit && tsc -p ./tsconfig.frontend.json --noEmit && tsc -p ./tsconfig.tests.json --noEmit",
"ts-check": "npm-run-all ts-check:*",
"ts-check:backend": "tsc -p ./tsconfig.backend.json --noEmit",
"ts-check:frontend": "tsc -p ./tsconfig.frontend.json --noEmit",
"ts-check:tests": "tsc -p ./tsconfig.tests.json --noEmit",
"ts-check:frontend-tests": "tsc -p ./tsconfig.frontend.tests.json --noEmit",
"webpack": "node --no-warnings=ExperimentalWarning --import=tsx ./node_modules/webpack-cli/bin/cli.js --node-env=production --config webpack.config.esm.ts"
},
"license": "BSD-2-Clause",