mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 03:19:46 +00:00
Fix DittoRoute test
This commit is contained in:
parent
8528c4c39e
commit
0d1b7b8d37
1 changed files with 8 additions and 5 deletions
|
|
@ -1,12 +1,15 @@
|
|||
import { assertEquals } from '@std/assert';
|
||||
import { assertRejects } from '@std/assert';
|
||||
|
||||
import { DittoRoute } from './DittoRoute.ts';
|
||||
|
||||
Deno.test('DittoRoute', async () => {
|
||||
const route = new DittoRoute();
|
||||
const response = await route.request('/');
|
||||
const body = await response.json();
|
||||
|
||||
assertEquals(response.status, 500);
|
||||
assertEquals(body, { error: 'Missing required variable: db' });
|
||||
await assertRejects(
|
||||
async () => {
|
||||
await route.request('/');
|
||||
},
|
||||
Error,
|
||||
'Missing required variable: db',
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue