forked from words/an-array-of-english-words
-
Notifications
You must be signed in to change notification settings - Fork 3
/
test.js
33 lines (26 loc) · 913 Bytes
/
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
const expect = require('chai').expect
const woerter = require('.')
const they = it
describe('woerter', () => {
they('are in an array', () => {
expect(woerter).to.be.an('array')
})
they('are over 1,648,000 in number', () => {
expect(woerter.length).to.be.above(1.648 * 1000 * 1000)
})
they('can have one letter', () => {
expect(woerter.filter(word => word.length === 1).length).to.be.above(4)
})
they('can have two letters', () => {
expect(woerter.filter(word => word.length === 2).length).to.be.above(50)
})
they('can be lowercase', () => {
expect(woerter.filter(word => word === word.toLowerCase()).length).to.be.above(100)
})
they('can have uppercase', () => {
expect(woerter.filter(word => word !== word.toLowerCase()).length).to.be.above(100)
})
they('all have length', () => {
expect(woerter.every(word => word.length > 0)).to.equal(true)
})
})