-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathtest.js
More file actions
38 lines (29 loc) · 885 Bytes
/
test.js
File metadata and controls
38 lines (29 loc) · 885 Bytes
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
'use strict';
const reader = require('../lib/read.js');
const expect = require('chai').expect;
describe('Main File', function(){
require('../index.js');
describe('#wrongFilePath', function(){
it('should return an error', function(done){
let badPath = 'derp/wrong.txt';
reader.readInOrder(badPath, function(err){
expect(err).to.be.an('error');
});
done();
});
});
describe('#properAmountOfFiles', function(){
it('check number of files in array', function(done){
expect(reader.dataHolder.length).to.equal(3);
done();
});
});
describe('#filesMatchUp', function(){
it('check file order', function(done){
expect(reader.fileHolder[0]).to.equal('one.txt');
expect(reader.fileHolder[1]).to.equal('two.txt');
expect(reader.fileHolder[2]).to.equal('three.txt');
done();
});
});
});