forked from words/an-array-of-english-words
/
test.js
34 lines (27 loc) · 883 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
34
const expect = require('chai').expect
const words = require('.')
const they = it
describe('words', () => {
they('are in an array', () => {
expect(words).to.be.an('array')
})
they('are over 274,000 in number', () => {
expect(words.length).to.be.above(274 * 1000)
})
they('can have one letter', () => {
expect(words.filter(word => word.length === 1).length).to.be.above(4)
})
they('can have two letters', () => {
expect(words.filter(word => word.length === 2).length).to.be.above(50)
})
they('are all lowercase', () => {
expect(words.every(word => word === word.toLowerCase())).to.equal(true)
})
they('all have length', () => {
expect(words.every(word => word.length > 0)).to.equal(true)
})
they('include latecomers like fuckton', () => {
expect(words).to.include('fuckton')
expect(words).to.include('fucktons')
})
})