-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test.js
46 lines (42 loc) · 849 Bytes
/
index.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
* @import {TestContext} from 'node:test'
*/
import test from 'node:test'
import assert from 'node:assert'
import { resolveEmail } from './index.js'
const inputs = [
{
in: '[email protected]',
expect: true,
},
{
in: '[email protected]',
expect: false,
},
{
in: '[email protected]',
expect: true,
},
{
in: '[email protected]',
expect: false,
},
{
in: '[email protected]',
expect: true,
},
{
in: '[email protected]',
expect: false,
},
]
for (const i of inputs) {
test(`${i.in} ${i.expect ? 'resolves' : 'does not resolve'}`, async (/** @type {TestContext} */ _t) => {
const results = await resolveEmail(i.in)
assert.strictEqual(
results.emailResolves,
i.expect,
`${i.in} ${i.expect ? 'resolves' : 'does not resolve'}`
)
})
}