Skip to content

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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