diff --git a/tests/validators.test.ts b/tests/validators.test.ts index 2787d08..94c2d0d 100644 --- a/tests/validators.test.ts +++ b/tests/validators.test.ts @@ -28,6 +28,11 @@ test('bool() works with various formats', () => { const f = cleanEnv({ FOO: 'f' }, { FOO: bool() }) expect(f).toEqual({ FOO: false }) + const yes = cleanEnv({ FOO: 'yes'}, { FOO: bool() }) + expect(yes).toEqual({ FOO: true }) + const no = cleanEnv({ FOO: 'no' }, { FOO: bool() }) + expect(no).toEqual({ FOO: false }) + const defaultF = cleanEnv({}, { FOO: bool({ default: false }) }) expect(defaultF).toEqual({ FOO: false }) })