Skip to content

Commit f98e4d0

Browse files
committed
Unit test fixes
Signed-off-by: Lucas <lucasoneil@gmail.com>
1 parent 81fab02 commit f98e4d0

5 files changed

Lines changed: 16 additions & 2 deletions

File tree

src/validators/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
export * from './validate-postal-code'
2-
export * from './validate-postal-code-required'
1+
export * from './is-postal-code-valid'
2+
export * from './is-postal-code-required'
File renamed without changes.
File renamed without changes.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,18 @@ describe('Validate Postal Code', () => {
5454
])('accepts any postal code "%s" for non-Canada', (postalCode) => {
5555
expect(isValidPostalCode(postalCode, { addressCountry: 'XX' })).toBe(true)
5656
})
57+
58+
it.each([
59+
null,
60+
undefined
61+
])('accepts %s postal code for Canada', (postalCode) => {
62+
expect(isValidPostalCode(postalCode as any, { addressCountry: 'CA' })).toBe(true)
63+
})
64+
65+
it.each([
66+
null,
67+
undefined
68+
])('accepts %s postal code for non-Canada', (postalCode) => {
69+
expect(isValidPostalCode(postalCode as any, { addressCountry: 'XX' })).toBe(true)
70+
})
5771
})

0 commit comments

Comments
 (0)