mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
config: test defaults
This commit is contained in:
parent
1e5278dc8c
commit
a2f273287d
1 changed files with 14 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { assertEquals } from '@std/assert';
|
||||
import { assertEquals, assertThrows } from '@std/assert';
|
||||
|
||||
import { DittoConfig } from './DittoConfig.ts';
|
||||
|
||||
|
|
@ -17,3 +17,16 @@ Deno.test('DittoConfig', async (t) => {
|
|||
assertEquals(config.pubkey, '1ba0c5ed1bbbf3b7eb0d7843ba16836a0201ea68a76bafcba507358c45911ff6');
|
||||
});
|
||||
});
|
||||
|
||||
Deno.test('DittoConfig defaults', async (t) => {
|
||||
const env = new Map<string, string>();
|
||||
const config = new DittoConfig(env);
|
||||
|
||||
await t.step('nsec throws', () => {
|
||||
assertThrows(() => config.nsec);
|
||||
});
|
||||
|
||||
await t.step('port', () => {
|
||||
assertEquals(config.port, 4036);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue