Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
lilnasy committed Feb 29, 2024
1 parent 79d3602 commit d10efd6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/astro/test/redirects.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,18 @@ describe('Astro.redirect', () => {
await fixture.build();
});

it('Does not output redirect HTML', async () => {
it('Does not output redirect HTML for redirect routes', async () => {
let oneHtml = undefined;
try {
oneHtml = await fixture.readFile('/one/index.html');
} catch {}
assert.equal(oneHtml, undefined);
});

it('Outputs redirect HTML for user routes that return a redirect response', async () => {
let secretHtml = await fixture.readFile('/secret/index.html');
assert.equal(secretHtml.includes("Redirecting from <code>/secret/</code>"), true);
assert.equal(secretHtml.includes("to <code>/login</code>"), true);
});
});
});

0 comments on commit d10efd6

Please sign in to comment.