test: add Vitest + 30 dice-engine tests
- Install vitest and @vitest/coverage-v8 - Add test scripts to package.json - Create vitest.config.ts - Add 30 comprehensive tests for parseDiceNotation, rollDice, rollAdvantage, buildNotation, isAdvancedNotation - Fix isAdvancedNotation regex to detect ro (reroll once)
This commit is contained in:
+8
-1
@@ -5,12 +5,19 @@
|
||||
"scripts": {
|
||||
"dev": "astro dev",
|
||||
"build": "astro build",
|
||||
"preview": "astro preview"
|
||||
"preview": "astro preview",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"test:coverage": "vitest run --coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"@astrojs/sitemap": "^3.2.1",
|
||||
"@tailwindcss/vite": "^4.0.0",
|
||||
"astro": "^4.16.0",
|
||||
"tailwindcss": "^4.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitest/coverage-v8": "^4.1.5",
|
||||
"vitest": "^4.1.5"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user