From 25731303b2e42c6bd56a3c92ae07a5760d348249 Mon Sep 17 00:00:00 2001
From: Nate Moore <nate@skypack.dev>
Date: Tue, 17 May 2022 15:52:30 -0500
Subject: [PATCH] test: add locale regression tests

---
 packages/astro/test/cli.test.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/packages/astro/test/cli.test.js b/packages/astro/test/cli.test.js
index 369c1210330e..98e0ade0a6be 100644
--- a/packages/astro/test/cli.test.js
+++ b/packages/astro/test/cli.test.js
@@ -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));