forked from bnurbekov/company-email-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
51 lines (42 loc) · 1.26 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
const expect = require('chai').expect;
const validator = require(".");
const validSupported =
[
];
const validUnsupported =
[
];
const invalidSupported =
[
];
describe('TEST EMAILS AGAINST VALIDATOR', () => {
describe('.isCompanyEmail', () => {
it('Should Be Valid', () => {
validSupported.forEach( email => {
expect(validator.isCompanyEmail(email)).to.equal(true);
});
});
it('Should Be Invalid', () => {
invalidSupported.forEach( email => {
expect(validator.isCompanyEmail(email)).to.equal(false);
});
});
it('Should Be Invalid(UnSupported By Module)', () => {
validUnsupported.forEach( email => {
expect(validator.isCompanyEmail(email)).to.equal(false);
});
});
});
describe('.isCompanyDomain', () => {
it('Should Allow Valid Domains', () => {
expect(validator.isCompanyDomain('utterly.app')).to.equal(true);
});
it('Should Disallow Public Domains', () => {
expect(validator.isCompanyDomain('gmail.com')).to.equal(false);
});
});
});