-
Notifications
You must be signed in to change notification settings - Fork 15
lab-regan #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
lab-regan #11
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.