repl
repl copied to clipboard
test: add unit tests generated by ToTheos
AI-Generated Unit Tests
This PR adds AI-generated unit tests to improve coverage and ensure key functionality is tested.
Test coverage summary
Statements : 81.94% ( 817/997 )
Branches : 70.91% ( 490/691 )
Functions : 73.25% ( 126/172 )
Lines : 84.92% ( 772/909 )
Coverage metrics generated by Jest, an open-source JavaScript testing framework.
Test files and commits
test: add configtest: add src/sourcemap.test.tstest: add src/types.test.tstest: add src/utils.test.tstest: add src/core.test.tstest: add src/index.test.tstest: add src/codemirror/codemirror.test.tstest: add src/vue-server-renderer-dev-proxy.test.tstest: add src/store.test.tstest: add src/transform.test.tstest: add src/import-map.test.tstest: add src/jsx.test.tstest: add src/monaco/vue.worker.test.tstest: add src/monaco/utils.test.tstest: add src/monaco/env.test.tstest: add src/monaco/highlight.test.tstest: add src/monaco/language-configs.test.tstest: add src/vue-dev-proxy.test.tstest: add src/output/PreviewProxy.test.tstest: add src/output/moduleCompiler.test.ts
How to run tests
Jestis included as a dev dependency.Run tests directly
./node_modules/.bin/jestOptional: add npm scripts
You can add convenient scripts to
package.json:{ "scripts": { "test": "jest", "test:watch": "jest --watch", "test:coverage": "jest --coverage --coverageReporters=text-summary" } }Usage examples
Run tests once:
pnpm run testRun tests in watch mode during development:
pnpm run test:watchRun tests with coverage summary:
pnpm run test:coverage
This contribution was created with assistance from ToTheos (https://totheos.com) to support test generation, code refactoring, and pull request preparation for an open-source codebases.
The tool was used to automate routine software development tasks.
@TESTPERSONAL is attempting to deploy a commit to the vuejs Team on Vercel.
A member of the Team first needs to authorize it.