@@ -11,8 +11,21 @@ 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 the swiss IBAN number 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+ [ "CH3400762ABC123DEF456" , true ] ,
22+ [ "CH34 0076 2ABC 123D EF45 6" , true ] ,
23+ [ "Some random string" , false ] ,
24+ [ "DE34 0076 2ABC 123D EF45 3" , false ] ,
25+ [ "CH34 0076 2ABC 123D EF45 \n6" , false ] ,
26+ [ "CH34 0076 2ABC 123D EF45 !" , false ] ,
27+ ] ) ( "check if the siwss IBAN number with letters is valid or not" , ( iBanNumberToCheck , expected ) => {
28+ expect ( isValidSwissIbanNumber ( iBanNumberToCheck ) ) . toBe ( expected ) ;
1629 } ) ;
1730
1831 test . each ( [
@@ -26,7 +39,7 @@ describe("Swiss standards test", () => {
2639 [ "756.1234.5678.91" , false ] ,
2740 [ "test756.9217.0769.85" , false ] ,
2841 [ "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 ) ;
42+ ] ) ( "check if the social insurance number is valid or not" , ( socialInsuranceNumberToCheck , expected ) => {
43+ expect ( isValidSwissSocialInsuranceNumber ( socialInsuranceNumberToCheck ) ) . toBe ( expected ) ;
3144 } ) ;
3245} ) ;
0 commit comments