Skip to content

Commit 60814a0

Browse files
committed
update test
1 parent 40037a5 commit 60814a0

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

test/__snapshots__/index.test.ts.snap

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,31 @@ Object {
5050
}
5151
`;
5252

53+
exports[`validation tests fails with bad mailbox 2`] = `
54+
Object {
55+
"reason": "smtp",
56+
"valid": false,
57+
"validators": Object {
58+
"disposable": Object {
59+
"valid": true,
60+
},
61+
"mx": Object {
62+
"valid": true,
63+
},
64+
"regex": Object {
65+
"valid": true,
66+
},
67+
"smtp": Object {
68+
"reason": "Invalid Mailbox",
69+
"valid": true,
70+
},
71+
"typo": Object {
72+
"valid": true,
73+
},
74+
},
75+
}
76+
`;
77+
5378
exports[`validation tests fails with bad regex 1`] = `
5479
Object {
5580
"reason": "regex",
@@ -147,3 +172,26 @@ Object {
147172
},
148173
}
149174
`;
175+
176+
exports[`validation tests passes 2`] = `
177+
Object {
178+
"valid": true,
179+
"validators": Object {
180+
"disposable": Object {
181+
"valid": true,
182+
},
183+
"mx": Object {
184+
"valid": true,
185+
},
186+
"regex": Object {
187+
"valid": true,
188+
},
189+
"smtp": Object {
190+
"valid": true,
191+
},
192+
"typo": Object {
193+
"valid": true,
194+
},
195+
},
196+
}
197+
`;

test/index.test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,18 @@ describe('validation tests', () => {
2626
expect(res).toMatchSnapshot()
2727
})
2828

29+
it('fails with bad mailbox', async () => {
30+
const res = await validate('[email protected]')
31+
expect(res).toMatchSnapshot()
32+
})
33+
34+
it('passes', async () => {
35+
const res = await validate('[email protected]')
36+
expect(res).toMatchSnapshot()
37+
})
38+
2939
it('passes', async () => {
30-
const res = await validate('davidadler@gmail.com')
40+
const res = await validate('info@davidalbertoadler.com')
3141
expect(res).toMatchSnapshot()
3242
})
3343
})

0 commit comments

Comments
 (0)