explodorama / files / test / version.test.ts
version.test.ts
| 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', () => { |
| 6 | // The rules version is SIM_VERSION (shown in the menu); the README states it by hand. |
| 7 | it('the README states the current SIM_VERSION', () => { |
| 8 | const stated = readFileSync('README.md', 'utf8').match(/^Rules version: \*\*(\d+)\*\*/m)?.[1] |
| 9 | expect(Number(stated)).toBe(SIM_VERSION) |
| 10 | }) |
| 11 | }) |