0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-20 22:12:38 -05:00

[ci] format

This commit is contained in:
Arsh 2024-01-25 18:09:42 +00:00 committed by astrobot-houston
parent f3d22136e5
commit b2197a2bee
2 changed files with 8 additions and 4 deletions

View file

@ -343,7 +343,11 @@ export async function handleRoute({
})
);
}
if (response.status === 404 && has404Route(manifestData) && response.headers.get(REROUTE_DIRECTIVE_HEADER) !== "no") {
if (
response.status === 404 &&
has404Route(manifestData) &&
response.headers.get(REROUTE_DIRECTIVE_HEADER) !== 'no'
) {
const fourOhFourRoute = await matchRoute('/404', manifestData, pipeline);
if (options && fourOhFourRoute?.route !== options.route)
return handleRoute({

View file

@ -249,10 +249,10 @@ describe('Development Routing', () => {
it('error responses are served untouched', async () => {
const response = await fixture.fetch('/not-ok');
expect(response.status).to.equal(404);
expect(response.headers.get("Content-Type")).to.equal("text/plain;charset=UTF-8");
expect(response.headers.get('Content-Type')).to.equal('text/plain;charset=UTF-8');
const body = await response.text();
expect(body).to.equal("Text from pages/not-ok.ts");
})
expect(body).to.equal('Text from pages/not-ok.ts');
});
it('correct MIME type when loading /home.json (static route)', async () => {
const response = await fixture.fetch('/home.json');