mirror of
https://github.com/withastro/astro.git
synced 2025-01-06 22:10:10 -05:00
[ci] format
This commit is contained in:
parent
9fd24a546c
commit
a1b324b31b
1 changed files with 18 additions and 18 deletions
|
@ -37,23 +37,23 @@ describe('trailingSlash', () => {
|
||||||
await container.close();
|
await container.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should match the API route when request has a trailing slash', async () => {
|
it('should match the API route when request has a trailing slash', async () => {
|
||||||
const { req, res, text } = createRequestAndResponse({
|
const { req, res, text } = createRequestAndResponse({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: '/api/',
|
url: '/api/',
|
||||||
});
|
});
|
||||||
container.handle(req, res);
|
container.handle(req, res);
|
||||||
const json = await text();
|
const json = await text();
|
||||||
expect(json).to.equal('{"success":true}');
|
expect(json).to.equal('{"success":true}');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should NOT match the API route when request lacks a trailing slash', async () => {
|
it('should NOT match the API route when request lacks a trailing slash', async () => {
|
||||||
const { req, res, text } = createRequestAndResponse({
|
const { req, res, text } = createRequestAndResponse({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: '/api',
|
url: '/api',
|
||||||
});
|
});
|
||||||
container.handle(req, res);
|
container.handle(req, res);
|
||||||
expect(await text()).to.equal('');
|
expect(await text()).to.equal('');
|
||||||
expect(res.statusCode).to.equal(404);
|
expect(res.statusCode).to.equal(404);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue