explodorama / files / test / version.test.ts
version.test.ts
0b25f1ef 2026-10-24 Pavel Safronov | 1 | import { readFileSync } from 'node:fs' |
| 2 | import { describe, expect, it } from 'vitest' | |
| 3 | import { SIM_VERSION } from '../src/sim/record' | |
| 4 | ||
| 5 | describe('version', () => { | |
5607bea2 2026-10-31 Pavel Safronov | 6 | // The rules version is SIM_VERSION (shown in the menu); the README states it by hand. |
0b25f1ef 2026-10-24 Pavel Safronov | 7 | it('the README states the current SIM_VERSION', () => { |
5607bea2 2026-10-31 Pavel Safronov | 8 | const stated = readFileSync('README.md', 'utf8').match(/^Rules version: \*\*(\d+)\*\*/m)?.[1] |
0b25f1ef 2026-10-24 Pavel Safronov | 9 | expect(Number(stated)).toBe(SIM_VERSION) |
| 10 | }) | |
| 11 | }) |