From f1df27740b5c185e28ad73a810bb5dad6bb1e8cd Mon Sep 17 00:00:00 2001 From: Alexander Niebuhr Date: Wed, 6 Dec 2023 21:28:53 +0100 Subject: [PATCH] fix(netlify): tests (#96) Co-authored-by: Arsh <69170106+lilnasy@users.noreply.github.com> --- .changeset/stale-boats-joke.md | 5 +++++ .../functions/fixtures/base64-response/src/pages/font.js | 2 +- .../functions/fixtures/base64-response/src/pages/image.js | 2 +- .../test/functions/fixtures/cookies/src/pages/login.js | 2 +- .../test/functions/fixtures/split-support/src/env.d.ts | 1 + 5 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .changeset/stale-boats-joke.md create mode 100644 packages/netlify/test/functions/fixtures/split-support/src/env.d.ts diff --git a/.changeset/stale-boats-joke.md b/.changeset/stale-boats-joke.md new file mode 100644 index 000000000..d98f292bf --- /dev/null +++ b/.changeset/stale-boats-joke.md @@ -0,0 +1,5 @@ +--- +'@astrojs/netlify': minor +--- + +Fixes an issue where this package could not be installed alongside Astro 4.0. diff --git a/packages/netlify/test/functions/fixtures/base64-response/src/pages/font.js b/packages/netlify/test/functions/fixtures/base64-response/src/pages/font.js index 3ec4c8364..abe2677f0 100644 --- a/packages/netlify/test/functions/fixtures/base64-response/src/pages/font.js +++ b/packages/netlify/test/functions/fixtures/base64-response/src/pages/font.js @@ -1,5 +1,5 @@ -export function get() { +export function GET() { const buffer = Buffer.from('base64 test font', 'utf-8') return new Response(buffer, { diff --git a/packages/netlify/test/functions/fixtures/base64-response/src/pages/image.js b/packages/netlify/test/functions/fixtures/base64-response/src/pages/image.js index ca3b4d9d3..3cd266481 100644 --- a/packages/netlify/test/functions/fixtures/base64-response/src/pages/image.js +++ b/packages/netlify/test/functions/fixtures/base64-response/src/pages/image.js @@ -1,5 +1,5 @@ -export function get() { +export function GET() { const buffer = Buffer.from('base64 test string', 'utf-8') return new Response(buffer, { diff --git a/packages/netlify/test/functions/fixtures/cookies/src/pages/login.js b/packages/netlify/test/functions/fixtures/cookies/src/pages/login.js index a9ca52f69..3f1fe17b5 100644 --- a/packages/netlify/test/functions/fixtures/cookies/src/pages/login.js +++ b/packages/netlify/test/functions/fixtures/cookies/src/pages/login.js @@ -1,5 +1,5 @@ -export function post() { +export function POST() { const headers = new Headers(); headers.append('Set-Cookie', `foo=foo; HttpOnly`); headers.append('Set-Cookie', `bar=bar; HttpOnly`); diff --git a/packages/netlify/test/functions/fixtures/split-support/src/env.d.ts b/packages/netlify/test/functions/fixtures/split-support/src/env.d.ts new file mode 100644 index 000000000..8c34fb45e --- /dev/null +++ b/packages/netlify/test/functions/fixtures/split-support/src/env.d.ts @@ -0,0 +1 @@ +/// \ No newline at end of file