Skip to content

Commit e95d1a2

Browse files
author
Nate Moore
committed
test: add locale regression tests
1 parent 857f038 commit e95d1a2

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

packages/astro/test/cli.test.js

+12
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,18 @@ describe('astro cli', () => {
2525
expect(proc.stdout).to.include(pkgVersion);
2626
});
2727

28+
const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
29+
const LOCALES = ['en_US', 'sv_SE', 'es_419.UTF-8', 'es_ES@euro', 'C'];
30+
LOCALES.forEach((locale) => {
31+
it(`astro does NOT throw on "${locale}" locales`, async () => {
32+
const projectRootURL = new URL('./fixtures/astro-basic/', import.meta.url);
33+
const proc = cli('dev', '--root', fileURLToPath(projectRootURL), { extendEnv: false, env: { LANG: locale }});
34+
35+
await Promise.race([proc, sleep(5000).then(() => proc.kill(0))]);
36+
expect(proc.exitCode).to.equal(0, ``);
37+
});
38+
})
39+
2840
it('astro build', async () => {
2941
const projectRootURL = new URL('./fixtures/astro-basic/', import.meta.url);
3042
const proc = await cli('build', '--root', fileURLToPath(projectRootURL));

0 commit comments

Comments
 (0)