Skip to content

Commit

Permalink
🧹 chore: fix test case for acepting numeric offset date
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltyAom committed Dec 4, 2024
1 parent e7dfe29 commit 9ab72e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/type-system/date.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ describe('TypeSystem - Date', () => {
expect(Value.Check(schema, '2021/1/1')).toEqual(true)

expect(Value.Check(schema, 'yay')).toEqual(false)
expect(Value.Check(schema, 42)).toEqual(false)
expect(Value.Check(schema, 42)).toEqual(true)
expect(Value.Check(schema, {})).toEqual(false)
expect(Value.Check(schema, undefined)).toEqual(false)
expect(Value.Check(schema, null)).toEqual(false)
Expand All @@ -36,7 +36,7 @@ describe('TypeSystem - Date', () => {
'The encoded value does not match the expected schema'
)
expect(() => Value.Encode(schema, 'yay')).toThrow(error)
expect(() => Value.Encode(schema, 42)).toThrow(error)
expect(() => Value.Encode(schema, 42)).not.toThrow(error)
expect(() => Value.Encode(schema, {})).toThrow(error)
expect(() => Value.Encode(schema, undefined)).toThrow(error)
expect(() => Value.Encode(schema, null)).toThrow(error)
Expand All @@ -56,7 +56,7 @@ describe('TypeSystem - Date', () => {
'Unable to decode value as it does not match the expected schema'
)
expect(() => Value.Decode(schema, 'yay')).toThrow(error)
expect(() => Value.Decode(schema, 42)).toThrow(error)
expect(() => Value.Decode(schema, 42)).not.toThrow(error)
expect(() => Value.Decode(schema, {})).toThrow(error)
expect(() => Value.Decode(schema, undefined)).toThrow(error)
expect(() => Value.Decode(schema, null)).toThrow(error)
Expand Down

0 comments on commit 9ab72e8

Please sign in to comment.