From 1482b927d5d6156283bc64fe6278d267a40d927d Mon Sep 17 00:00:00 2001 From: ktym4a Date: Fri, 2 Feb 2024 17:07:17 +0700 Subject: [PATCH] Add new test cases for non-UTF-8 and space file names --- packages/astro/test/dev-routing.test.js | 30 +++++++++++++++++++ .../without-site-config/src/pages/te st.astro | 1 + ...343\203\206\343\202\271\343\203\210.astro" | 1 + 3 files changed, 32 insertions(+) create mode 100644 packages/astro/test/fixtures/without-site-config/src/pages/te st.astro create mode 100644 "packages/astro/test/fixtures/without-site-config/src/pages/\343\203\206\343\202\271\343\203\210.astro" diff --git a/packages/astro/test/dev-routing.test.js b/packages/astro/test/dev-routing.test.js index ce71a5d59e10..4feef55833da 100644 --- a/packages/astro/test/dev-routing.test.js +++ b/packages/astro/test/dev-routing.test.js @@ -22,6 +22,16 @@ describe('Development Routing', () => { expect(response.status).to.equal(200); }); + it('200 when loading non-UTF-8 file name', async () => { + const response = await fixture.fetch('/テスト'); + expect(response.status).to.equal(200); + }); + + it('200 when loading include space file name', async () => { + const response = await fixture.fetch('/te st'); + expect(response.status).to.equal(200); + }); + it('200 when adding search params', async () => { const response = await fixture.fetch('/?foo=bar'); expect(response.status).to.equal(200); @@ -315,6 +325,26 @@ describe('Development Routing', () => { expect(response.status).to.equal(200); }); + it('200 when loading /テスト.html', async () => { + const response = await fixture.fetch('/テスト.html'); + expect(response.status).to.equal(200); + }); + + it('200 when loading /テスト', async () => { + const response = await fixture.fetch('/テスト'); + expect(response.status).to.equal(200); + }); + + it('200 when loading /te st.html', async () => { + const response = await fixture.fetch('/te st.html'); + expect(response.status).to.equal(200); + }); + + it('200 when loading /te st', async () => { + const response = await fixture.fetch('/te st'); + expect(response.status).to.equal(200); + }); + it('200 when loading /another.html', async () => { const response = await fixture.fetch('/another.html'); expect(response.status).to.equal(200); diff --git a/packages/astro/test/fixtures/without-site-config/src/pages/te st.astro b/packages/astro/test/fixtures/without-site-config/src/pages/te st.astro new file mode 100644 index 000000000000..42e6a5177169 --- /dev/null +++ b/packages/astro/test/fixtures/without-site-config/src/pages/te st.astro @@ -0,0 +1 @@ +
testing
\ No newline at end of file diff --git "a/packages/astro/test/fixtures/without-site-config/src/pages/\343\203\206\343\202\271\343\203\210.astro" "b/packages/astro/test/fixtures/without-site-config/src/pages/\343\203\206\343\202\271\343\203\210.astro" new file mode 100644 index 000000000000..42e6a5177169 --- /dev/null +++ "b/packages/astro/test/fixtures/without-site-config/src/pages/\343\203\206\343\202\271\343\203\210.astro" @@ -0,0 +1 @@ +
testing
\ No newline at end of file