File tree 1 file changed +46
-0
lines changed
1 file changed +46
-0
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,29 @@ describe('Validators', () => {
140
140
} ) ;
141
141
} ) ;
142
142
143
+ it ( 'should not validate email addresses with non-ASCII domain names if allow_idn is set to false' , ( ) => {
144
+ test ( {
145
+ validator : 'isEmail' ,
146
+ args : [ { allow_idn : false } ] ,
147
+ valid : [ ] ,
148
+ invalid : [
149
+ 'ka25maj@gˇmail.com' ,
150
+ 'i18n@exampلe.com' ,
151
+ 'i18n@EXАМПЛЕ.com' ,
152
+ 'i18n@exамple.com' ,
153
+ 'i18n@éxample.com' ,
154
+ 'i18n@eßample.com' ,
155
+ 'i18n@EXΑΜΠΛΕ.com' ,
156
+ 'i18n@exαmple.com' ,
157
+ 'i18n@exampłe.com' ,
158
+ 'i18n@eซample.com' ,
159
+ 'i18n@例題.com' ,
160
+ 'i18n@例え.com' ,
161
+ 'i18n@사례.com' ,
162
+ ] ,
163
+ } ) ;
164
+ } ) ;
165
+
143
166
it ( 'should validate email addresses with display names' , ( ) => {
144
167
test ( {
145
168
validator : 'isEmail' ,
@@ -828,6 +851,29 @@ describe('Validators', () => {
828
851
} ) ;
829
852
} ) ;
830
853
854
+ it ( 'should not validate URLs with non-ASCII domain names if allow_idn is set to false' , ( ) => {
855
+ test ( {
856
+ validator : 'isURL' ,
857
+ args : [ { allow_idn : false } ] ,
858
+ valid : [ ] ,
859
+ invalid : [
860
+ 'gˇmail.com' ,
861
+ 'exampلe.com' ,
862
+ 'EXАМПЛЕ.com' ,
863
+ 'exамple.com' ,
864
+ 'éxample.com' ,
865
+ 'eßample.com' ,
866
+ 'EXΑΜΠΛΕ.com' ,
867
+ 'exαmple.com' ,
868
+ 'exampłe.com' ,
869
+ 'eซample.com' ,
870
+ '例題.com' ,
871
+ '例え.com' ,
872
+ '사례.com' ,
873
+ ] ,
874
+ } ) ;
875
+ } ) ;
876
+
831
877
it ( 'should validate MAC addresses' , ( ) => {
832
878
test ( {
833
879
validator : 'isMACAddress' ,
You can’t perform that action at this time.
0 commit comments