Skip to content

Conversation

reganoneill
Copy link

No description provided.

test/test.js Outdated
@@ -0,0 +1,24 @@
'use strict';

const reader = require('../lib/read.js').readInOrder;
Copy link

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' ]);
Copy link

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);
});
Copy link

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'];
Copy link

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');
Copy link

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();
});
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants