Conversation
test/test.js
Outdated
| @@ -0,0 +1,24 @@ | |||
| 'use strict'; | |||
|
|
|||
| const reader = require('../lib/read.js').readInOrder; | |||
There was a problem hiding this comment.
This line here is setting the const 'reader' to the single function 'readInOrder'. Not the entire exported object.
test/test.js
Outdated
| describe('#properOrder', function(){ | ||
| it('should check the tests run in correct order', function(done){ | ||
| var outcome = reader.readInOrder(reader.returnHex(exports.getHexxed)); | ||
| expect(outcome).to.equal([ '66697273', '7365636f', '74686972' ]); |
There was a problem hiding this comment.
This line here is looking on the const 'reader' for the attached functions 'readInOrder' and 'returnHex'. But they don't exist on 'reader' based on what you have set 'reader' to on line 3.
| getHexxed.push(thirdHex); | ||
|
|
||
| callback(getHexxed); | ||
| }); |
There was a problem hiding this comment.
Good job. This will make sure that they are returned in order.
|
|
||
| module.exports = exports = {}; | ||
|
|
||
| exports.fileHolder = ['one.txt', 'two.txt', 'three.txt']; |
There was a problem hiding this comment.
You could use this down below instead of hardcoding in the filenames.
|
|
||
| describe('Main File', function(){ | ||
|
|
||
| require('../index.js'); |
There was a problem hiding this comment.
No sure if you actually need to require this in here.
| expect(reader.fileHolder[1]).to.equal('two.txt'); | ||
| expect(reader.fileHolder[2]).to.equal('three.txt'); | ||
| done(); | ||
| }); |
There was a problem hiding this comment.
Hmmm. It looks like you are just checking what your object holds here. Not what your function is returning. You should add a test that tests that your function is returning the files in the correct order.
No description provided.