Skip to content

Lab-03-Logan-Absher#11

Open
loganabsher wants to merge 2 commits intocodefellows-javascript-401d17:masterfrom
loganabsher:master
Open

Lab-03-Logan-Absher#11
loganabsher wants to merge 2 commits intocodefellows-javascript-401d17:masterfrom
loganabsher:master

Conversation

@loganabsher
Copy link
Copy Markdown

No description provided.

describe('logging in correct order', () => {
it('Should log one.txt then two.txt then three.txt', (done) => {
fr.fileRunner((err) => {
expect(err).to.equal('null');
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

the string 'null' is different from the keyword null; Also you are passing in a callback function to a function that has a first parameter of path.Also you want this function to be able to accept some sort of Data back so that you can actually test that.


exports.fileRunner = (err, data) => {
const filesNames = ['one.txt', 'two.txt', 'three.txt'];
filesNames.forEach((ele) => {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This does not guarantee that they will complete in order. If the first takes longer then the 2nd it could be different. They will probably come back in order because on your computer it happens so fast that it won't be super noticeable and the speeds won't vary much. Also you are passing through ele, and err which the ele is the path so that is fine but the err is actually the callback from the test. While technically this is correct because fileReader wants the callback you shouldn't be calling it error because that isn't what it is.

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