Skip to content

Commit

Permalink
test: add locale regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nate Moore committed May 17, 2022
1 parent 857f038 commit e95d1a2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/astro/test/cli.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ describe('astro cli', () => {
expect(proc.stdout).to.include(pkgVersion);
});

const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
const LOCALES = ['en_US', 'sv_SE', 'es_419.UTF-8', 'es_ES@euro', 'C'];
LOCALES.forEach((locale) => {
it(`astro does NOT throw on "${locale}" locales`, async () => {
const projectRootURL = new URL('./fixtures/astro-basic/', import.meta.url);
const proc = cli('dev', '--root', fileURLToPath(projectRootURL), { extendEnv: false, env: { LANG: locale }});

await Promise.race([proc, sleep(5000).then(() => proc.kill(0))]);
expect(proc.exitCode).to.equal(0, ``);
});
})

it('astro build', async () => {
const projectRootURL = new URL('./fixtures/astro-basic/', import.meta.url);
const proc = await cli('build', '--root', fileURLToPath(projectRootURL));
Expand Down

0 comments on commit e95d1a2

Please sign in to comment.