Skip to content

Commit db0a402

Browse files
authored
chore(isTaxID): test against valid and invalid US TIN prefixes (#1408)
The existing isTaxId validation tests only checked the format, while the validation code also tests for valid (US campus) prefixes. The added tests, check that the prefix validations actually work.
1 parent 28f7f65 commit db0a402

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

test/validators.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8660,12 +8660,21 @@ describe('Validators', () => {
86608660
valid: [
86618661
'01-1234567',
86628662
'01 1234567',
8663-
'011234567'],
8663+
'011234567',
8664+
'10-1234567',
8665+
'02-1234567',
8666+
'67-1234567',
8667+
'15-1234567',
8668+
'31-1234567',
8669+
'99-1234567'],
86648670
invalid: [
86658671
'0-11234567',
86668672
'01#1234567',
86678673
'01 1234567',
8668-
'01 1234 567'],
8674+
'01 1234 567',
8675+
'07-1234567',
8676+
'28-1234567',
8677+
'96-1234567'],
86698678
});
86708679
test({
86718680
validator: 'isTaxID',
@@ -8678,6 +8687,9 @@ describe('Validators', () => {
86788687
'01#1234567',
86798688
'01 1234567',
86808689
'01 1234 567',
8690+
'07-1234567',
8691+
'28-1234567',
8692+
'96-1234567',
86818693
],
86828694
});
86838695
});

0 commit comments

Comments
 (0)