Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Conduitry committed May 25, 2023
1 parent 42f7d29 commit 9a7d817
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export const prerender = true;

export const GET = () => {
const response = new Response('foo');
// this simulates immutable Response Headers, like those returned by undici
Object.defineProperty(response.headers, 'set', { value: null });
return response;
};
5 changes: 5 additions & 0 deletions packages/kit/test/prerendering/basics/test/tests.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,3 +223,8 @@ test('prerendered.paths omits trailing slashes for endpoints', () => {
expect(content, `Missing ${path}`).toMatch(`"${path}"`);
}
});

test('prerenders responses with immutable Headers', () => {
const content = read('immutable-headers');
expect(content).toMatch('foo');
});

0 comments on commit 9a7d817

Please sign in to comment.