-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathspec.js
35 lines (34 loc) · 929 Bytes
/
spec.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
const count = require('.');
describe('count', () => {
it('Should count', () => {
expect(count()).to.equal('1st');
expect(count()).to.equal('2nd');
});
it('Should continue to count', () => {
expect(count()).to.equal('3rd');
expect(count()).to.equal('4th');
});
it('Should reset to 0', () => {
expect(count()).to.equal('5th');
count.reset();
expect(count()).to.equal('1st');
});
it('Should set to given number', () => {
expect(count()).to.equal('2nd');
count.set(6);
expect(count()).to.equal('7th');
});
it('Should start from given number', () => {
expect(count()).to.equal('8th');
expect(count.from(6)).to.equal('7th');
});
it('Should count down', () => {
expect(count.down()).to.equal('6th');
expect(count.down()).to.equal('5th');
});
it('Should count negative numbers', () => {
count.reset();
expect(count.down()).to.equal('-1st');
expect(count.down()).to.equal('-2nd');
});
});