mirror of
https://gitlab.com/soapbox-pub/ditto.git
synced 2025-12-06 11:29:46 +00:00
13 lines
465 B
TypeScript
13 lines
465 B
TypeScript
import { assertEquals, assertThrows } from '@std/assert';
|
|
|
|
import { booleanParamSchema } from './schema.ts';
|
|
|
|
Deno.test('booleanParamSchema', () => {
|
|
assertEquals(booleanParamSchema.parse('true'), true);
|
|
assertEquals(booleanParamSchema.parse('false'), false);
|
|
|
|
assertThrows(() => booleanParamSchema.parse('invalid'));
|
|
assertThrows(() => booleanParamSchema.parse('undefined'));
|
|
|
|
assertEquals(booleanParamSchema.optional().parse(undefined), undefined);
|
|
});
|