feat: v0.3.1 — show app version in header (sourced from package.json)
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
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}');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user