import { readFileSync } from 'node:fs'; import pkg from '../package.json'; import { describe, expect, it } from 'vitest'; const mapSource = readFileSync(new URL('./Map.tsx', import.meta.url), 'utf8'); describe('app version display', () => { it('package.json carries a valid semver version (single source of truth)', () => { expect(pkg.version).toMatch(/^\d+\.\d+\.\d+$/); }); it('the header sources the version from package.json instead of hardcoding it', () => { expect(mapSource).toContain("from '../package.json'"); expect(mapSource).toContain('v{pkg.version}'); }); });