Sets output to static (Astro default) with path-based i18n routing (/en/, /fr/) and no unprefixed default-locale route, per the hub landing page design spec.
16 lines
532 B
TypeScript
16 lines
532 B
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { readFileSync, existsSync } from 'node:fs';
|
|
|
|
describe('locale routing', () => {
|
|
it('builds /en/ and /fr/ pages with correct lang attributes', () => {
|
|
const en = readFileSync('dist/en/index.html', 'utf-8');
|
|
const fr = readFileSync('dist/fr/index.html', 'utf-8');
|
|
expect(en).toContain('lang="en"');
|
|
expect(fr).toContain('lang="fr"');
|
|
});
|
|
|
|
it('does not build an unprefixed root page', () => {
|
|
expect(existsSync('dist/index.html')).toBe(false);
|
|
});
|
|
});
|