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:
emil
2026-05-10 21:12:08 +03:00
parent 3750cd2cc6
commit bb62d7310e
5 changed files with 903 additions and 57 deletions
+9
View File
@@ -0,0 +1,9 @@
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
globals: true,
environment: 'node',
include: ['src/**/*.test.ts'],
},
});