@@ -11,8 +11,16 @@ describe("Swiss standards test", () => {
1111 [ "CH93 0000 0000 0000 0000 1" , false ] ,
1212 [ "ch93 0076 2011 6238 5295 7" , false ] ,
1313 [ "DE93 0076 2011 6238 5295 7" , false ] ,
14- ] ) ( "check if this swiss IBAN is valid or not" , ( unformattedIbanNumber , expected ) => {
15- expect ( isValidSwissIbanNumber ( unformattedIbanNumber ) ) . toBe ( expected ) ;
14+ ] ) ( "check if this swiss IBAN is valid or not" , ( iBanNumberToCheck , expected ) => {
15+ expect ( isValidSwissIbanNumber ( iBanNumberToCheck ) ) . toBe ( expected ) ;
16+ } ) ;
17+
18+ test . each ( [
19+ [ null as unknown as string , false ] ,
20+ [ undefined as unknown as string , false ] ,
21+ [ "CH35 0023 0230 1234 5601 X" , true ] ,
22+ ] ) ( "check if this siwss IBAN with letters is valid or not" , ( iBanNumberToCheck , expected ) => {
23+ expect ( isValidSwissIbanNumber ( iBanNumberToCheck ) ) . toBe ( expected ) ;
1624 } ) ;
1725
1826 test . each ( [
@@ -26,7 +34,7 @@ describe("Swiss standards test", () => {
2634 [ "756.1234.5678.91" , false ] ,
2735 [ "test756.9217.0769.85" , false ] ,
2836 [ "7.56..9217...0769.85" , false ] ,
29- ] ) ( "check if the social insurance number is valid or not" , ( ahvNumber , expected ) => {
30- expect ( isValidSwissSocialInsuranceNumber ( ahvNumber ) ) . toBe ( expected ) ;
37+ ] ) ( "check if the social insurance number is valid or not" , ( socialInsuranceNumberToCheck , expected ) => {
38+ expect ( isValidSwissSocialInsuranceNumber ( socialInsuranceNumberToCheck ) ) . toBe ( expected ) ;
3139 } ) ;
3240} ) ;
0 commit comments