Skip to content
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

tests time out #3

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

Conversation

annaul
Copy link

@annaul annaul commented Feb 16, 2017

No description provided.


const files = require('./lib/read.js');

files.printOut();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job requiring your function in here. But you aren't quite calling it correctly. files.printOut is not a function. How can you refactor index.js so that it is calling your function correctly?


var logArray = [];
fs.readFile(textFiles[0], function(err, data) {
if (err) return callback(err);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job returning your callback with the err.

var logArray = [];
fs.readFile(textFiles[0], function(err, data) {
if (err) return callback(err);
f1 = data.slice(0, 8).toString()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget the assignment asks for the first 8bits in 'HEX'.

"license": "ISC",
"devDependencies": {
"chai": "^3.5.0",
"mocha": "^3.2.0"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't forget to add gulp-mocha and gulp-eslint as devDependencies.

logArray.push(f3);
console.log(f3);
return callback(null, logArray);
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job pushing your values into an array and returning the array with the callback.

done();
});
});

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job checking that the files are returned in the correct order. You could refactor this slightly though so that it is only calling the function one time. Then just add the rest of the expect statements into the same test. Kind of like this:
expect(data[0]).to.equal('Same an ');
expect(data[1]).to.equal('Do great'):
expect(data[2]).to.equal('Unwillin'):

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