-
Notifications
You must be signed in to change notification settings - Fork 15
Test fixed #21
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?
Test fixed #21
Conversation
var dataNum = []; | ||
|
||
fs.readFile(pathArray[0], function(err, data) { | ||
if (err) 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 calling the callback with the err.
@@ -0,0 +1 @@ | |||
Hello this is test two |
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.
The first 8 bytes of your test files are all the same. Each one needs to be different in order for you to tell if they are logging out in the order that you are looking for.
|
||
const gulp = require('gulp'); | ||
const eslint = require('gulp-eslint'); | ||
const mocha = require('gulp-mocha'); |
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 are requiring gulp-mocha here but it is not in your package.json. Make sure that you save it as a devDependency.
fileReader(`${__dirname}/./data/two.txt`, function(err, data) { | ||
if (err) throw err; | ||
console.log('three:', data.toString('hex', 0, 8)); | ||
}); |
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.
Your index should just call the function that you set up in file-reader.js one time and hand it a callback. So you can run 'node index.js in the terminal and see it output the three files in order.
console.log(dataNum); | ||
callback(null, dataNum); | ||
|
||
}); |
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.
Great job with this. I like that your function takes an array of file names as a parameter.
done(); | ||
}); | ||
it('should have correct order of hex strings', (done) => { | ||
var dataNum = ['48656c6c6f207468', '48656c6c6f207468', '48656c6c6f207468']; |
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.
These are all the same. How can you tell what order they are coming back in?
No description provided.