import { describe, it, expect, beforeAll } from 'vitest'; import { execSync } from 'node:child_process'; import { readFileSync } from 'node:fs'; describe('root language redirect', () => { beforeAll(() => { execSync('npm run build', { stdio: 'inherit' }); }); it('copies .htaccess to dist with the french/english redirect rules', () => { const htaccess = readFileSync('dist/.htaccess', 'utf-8'); expect(htaccess).toContain('RewriteEngine On'); expect(htaccess).toContain('HTTP:Accept-Language} fr'); expect(htaccess).toContain('RewriteRule ^$ /fr/ [R=302,L]'); expect(htaccess).toContain('RewriteRule ^$ /en/ [R=302,L]'); }); });