forked from ivolo/disposable-email-domains
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
33 lines (31 loc) · 987 Bytes
/
index.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
const _ = require('lodash');
const domains = require('../index');
const chai = require('chai');
const expect = chai.expect;
chai.use(require("chai-sorted"));
chai.use(require('./helpers/lowercase'));
chai.use(require('./helpers/isFQDN'));
chai.use(require('./helpers/notInWildcard'));
describe('Domains', function(){
it('should be an array', function(){
expect(domains).to.be.a('array');
});
it('should have at least one domain', function(){
expect(domains).to.have.length.above(0);
});
it('should be in alphabetical order', function(){
expect(domains).to.be.sorted();
});
it('should not have duplicates', function(){
expect(domains).to.deep.equal(_.uniq(domains));
});
it('should be lowercase', function(){
expect(domains).to.be.all.lowercase;
});
it('should be a valid domain', function(){
expect(domains).to.be.all.isFQDN;
});
it('should not be a wildcard domain', function(){
expect(domains).to.be.all.notInWildcard;
});
});