Add vitest test framework

Adds two new npm scripts:

- 'test' - runs test suite once and exits
- 'test:watch' - runs test suite perpetually.

Any file suffixed with '.test.[js|ts]' is considered a test suite
This commit is contained in:
Dmitriy Dubson 2023-10-03 10:25:00 -04:00
parent e4ebe14340
commit 705d0c9a0f
3 changed files with 1680 additions and 0 deletions

View File

@ -27,3 +27,6 @@ jobs:
- name: Run tsc
run: npm run build:check
- name: Run test suite
run: npm run test

1674
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -58,6 +58,7 @@
"stylelint-scss": "5.0.0",
"ts-loader": "9.4.4",
"typescript": "5.0.4",
"vitest": "0.34.6",
"webpack": "5.88.1",
"webpack-bundle-analyzer": "4.9.1",
"webpack-cli": "5.1.4",
@ -145,6 +146,8 @@
"build:check": "tsc --noEmit",
"escheck": "es-check",
"lint": "eslint \"./\"",
"test": "vitest --watch=false",
"test:watch": "vitest",
"stylelint": "npm run stylelint:css && npm run stylelint:scss",
"stylelint:css": "stylelint \"src/**/*.css\"",
"stylelint:scss": "stylelint --config=\".stylelintrc.scss.json\" \"src/**/*.scss\""