-
Notifications
You must be signed in to change notification settings - Fork 17
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
base: master
Are you sure you want to change the base?
Conversation
|
||
const files = require('./lib/read.js'); | ||
|
||
files.printOut(); |
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 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); |
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 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() |
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.
Don't forget the assignment asks for the first 8bits in 'HEX'.
"license": "ISC", | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"mocha": "^3.2.0" |
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.
Don't forget to add gulp-mocha and gulp-eslint as devDependencies.
logArray.push(f3); | ||
console.log(f3); | ||
return callback(null, logArray); | ||
}); |
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 pushing your values into an array and returning the array with the callback.
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.
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'):
No description provided.