File tree Expand file tree Collapse file tree 2 files changed +53
-2
lines changed Expand file tree Collapse file tree 2 files changed +53
-2
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,31 @@ Object {
200
200
}
201
201
` ;
202
202
203
+ exports [` validation tests fails without sending data 1` ] = `
204
+ Object {
205
+ " reason" : " smtp" ,
206
+ " valid" : false ,
207
+ " validators" : Object {
208
+ " disposable" : Object {
209
+ " valid" : true ,
210
+ },
211
+ " mx" : Object {
212
+ " valid" : true ,
213
+ },
214
+ " regex" : Object {
215
+ " valid" : true ,
216
+ },
217
+ " smtp" : Object {
218
+ " reason" : " Mail server closed connection without sending any data." ,
219
+ " valid" : false ,
220
+ },
221
+ " typo" : Object {
222
+ " valid" : true ,
223
+ },
224
+ },
225
+ }
226
+ ` ;
227
+
203
228
exports [` validation tests passes when valid special char 1` ] = `
204
229
Object {
205
230
" valid" : true ,
@@ -223,6 +248,29 @@ Object {
223
248
}
224
249
` ;
225
250
251
+ exports [` validation tests passes when valid special char 2` ] = `
252
+ Object {
253
+ " valid" : true ,
254
+ " validators" : Object {
255
+ " disposable" : Object {
256
+ " valid" : true ,
257
+ },
258
+ " mx" : Object {
259
+ " valid" : true ,
260
+ },
261
+ " regex" : Object {
262
+ " valid" : true ,
263
+ },
264
+ " smtp" : Object {
265
+ " valid" : true ,
266
+ },
267
+ " typo" : Object {
268
+ " valid" : true ,
269
+ },
270
+ },
271
+ }
272
+ ` ;
273
+
226
274
exports [` validation tests passes when valid wildcard 1` ] = `
227
275
Object {
228
276
" valid" : true ,
Original file line number Diff line number Diff line change @@ -12,8 +12,11 @@ describe('validation tests', () => {
12
12
validateTypo : false ,
13
13
validateDisposable : false ,
14
14
} )
15
- console . log ( res )
16
- } , 30000 )
15
+ expect ( res . valid ) . toBe ( false )
16
+ expect ( res . reason ) . toBe ( 'smtp' )
17
+ expect ( res . validators . smtp ?. valid ) . toBe ( false )
18
+ expect ( res ) . toMatchSnapshot ( )
19
+ } )
17
20
it ( 'fails with bad regex' , async ( ) => {
18
21
const res = await validate ( 'david.gmail.com' )
19
22
expect ( res . valid ) . toBe ( false )
You can’t perform that action at this time.
0 commit comments