Skip to content

Commit 9ab72e8

Browse files
committed
🧹 chore: fix test case for acepting numeric offset date
1 parent e7dfe29 commit 9ab72e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/type-system/date.test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe('TypeSystem - Date', () => {
1616
expect(Value.Check(schema, '2021/1/1')).toEqual(true)
1717

1818
expect(Value.Check(schema, 'yay')).toEqual(false)
19-
expect(Value.Check(schema, 42)).toEqual(false)
19+
expect(Value.Check(schema, 42)).toEqual(true)
2020
expect(Value.Check(schema, {})).toEqual(false)
2121
expect(Value.Check(schema, undefined)).toEqual(false)
2222
expect(Value.Check(schema, null)).toEqual(false)
@@ -36,7 +36,7 @@ describe('TypeSystem - Date', () => {
3636
'The encoded value does not match the expected schema'
3737
)
3838
expect(() => Value.Encode(schema, 'yay')).toThrow(error)
39-
expect(() => Value.Encode(schema, 42)).toThrow(error)
39+
expect(() => Value.Encode(schema, 42)).not.toThrow(error)
4040
expect(() => Value.Encode(schema, {})).toThrow(error)
4141
expect(() => Value.Encode(schema, undefined)).toThrow(error)
4242
expect(() => Value.Encode(schema, null)).toThrow(error)
@@ -56,7 +56,7 @@ describe('TypeSystem - Date', () => {
5656
'Unable to decode value as it does not match the expected schema'
5757
)
5858
expect(() => Value.Decode(schema, 'yay')).toThrow(error)
59-
expect(() => Value.Decode(schema, 42)).toThrow(error)
59+
expect(() => Value.Decode(schema, 42)).not.toThrow(error)
6060
expect(() => Value.Decode(schema, {})).toThrow(error)
6161
expect(() => Value.Decode(schema, undefined)).toThrow(error)
6262
expect(() => Value.Decode(schema, null)).toThrow(error)

0 commit comments

Comments
 (0)