Skip to content

Commit 8c12306

Browse files
committed
test plain text responses
1 parent 8d7476e commit 8c12306

File tree

1 file changed

+7
-3
lines changed
  • packages/kit/test/apps/options/test

1 file changed

+7
-3
lines changed

packages/kit/test/apps/options/test/test.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,15 @@ test.describe.configure({ mode: 'parallel' });
77

88
test.describe('base path', () => {
99
test('serves a useful 404 when visiting unprefixed path', async ({ request }) => {
10-
const response = await request.get('/slash/', { headers: { Accept: 'text/html' } });
11-
expect(response.status()).toBe(404);
12-
expect(await response.text()).toBe(
10+
const html = await request.get('/slash/', { headers: { Accept: 'text/html' } });
11+
expect(html.status()).toBe(404);
12+
expect(await html.text()).toBe(
1313
'Not found (did you mean <a href="/path-base/slash/">/path-base/slash/</a>?)'
1414
);
15+
16+
const plain = await request.get('/slash/');
17+
expect(plain.status()).toBe(404);
18+
expect(await plain.text()).toBe('Not found (did you mean /path-base/slash/?)');
1519
});
1620

1721
test('serves /', async ({ page, javaScriptEnabled }) => {

0 commit comments

Comments
 (0)