-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
103 lines (58 loc) · 2.03 KB
/
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
var mailTest = require('./mail-tester.js');
var test = require('tape');
test('should get ACTIVE', function(assert) {
var email = 'abinav.n.seelan@gmail.com';
mailTest.check(email, function(data) {
assert.equal(data.code, '01', 'Checking if CODE = 01');
assert.equal(data.status, 'ACTIVE', 'Checking if STATUS = ACTIVE');
assert.end();
})
})
test('should get DISPOSABLE', function(assert) {
var email = 'hello@mailinator.com';
mailTest.check(email, function(data) {
assert.equal(data.code, '11', 'Checking if CODE = 11');
assert.equal(data.status, 'DISPOSABLE', 'Checking if STATUS = DISPOSABLE');
assert.end();
})
})
test('should get ROBOT', function(assert) {
var email = 'hello@robot.mailtest.in';
mailTest.check(email, function(data) {
assert.equal(data.code, '12', 'Checking if CODE = 12');
assert.equal(data.status, 'ROBOT', 'Checking if STATUS = ROBOT');
assert.end();
})
})
test('should get INVALID', function(assert) {
var email = 'hello@invalid.mailtest.in';
mailTest.check(email, function(data) {
assert.equal(data.code, '21', 'Checking if CODE = 21');
assert.equal(data.status, 'INVALID', 'CHECKING if STATUS = INVALID');
assert.end();
})
})
test('should get UNKNOWN', function(assert) {
var email = 'hello@unknown.mailtest.in';
mailTest.check(email, function(data) {
assert.equal(data.code, '82', 'Checking if CODE = 82');
assert.equal(data.status, 'UNKNOWN', 'Checking if STATUS = UNKNOWN');
assert.end();
})
})
test('should get ERROR', function(assert) {
var email = 'hello@error.mailtest.in';
mailTest.check(email, function(data) {
assert.equal(data.code, '92', 'Checking if CODE = 92');
assert.equal(data.status, 'ERROR', 'Checking if STATUS = ERROR');
assert.end();
})
})
test('should get INVALID_EMAIL', function(assert) {
var email = 'hello';
mailTest.check(email, function(data) {
assert.equal(data.code, '00', 'Checking if CODE = 00');
assert.equal(data.status, 'INVALID_EMAIL', 'Checking if STATUS = INVALID_EMAIL');
assert.end();
})
})