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 {
200200}
201201` ;
202202
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+
203228exports [` validation tests passes when valid special char 1` ] = `
204229Object {
205230 " valid" : true ,
@@ -223,6 +248,29 @@ Object {
223248}
224249` ;
225250
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+
226274exports [` validation tests passes when valid wildcard 1` ] = `
227275Object {
228276 " valid" : true ,
Original file line number Diff line number Diff line change @@ -12,8 +12,11 @@ describe('validation tests', () => {
1212 validateTypo : false ,
1313 validateDisposable : false ,
1414 } )
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+ } )
1720 it ( 'fails with bad regex' , async ( ) => {
1821 const res = await validate ( 'david.gmail.com' )
1922 expect ( res . valid ) . toBe ( false )
You can’t perform that action at this time.
0 commit comments