Skip to content

file process #1

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 1 commit into
base: master
Choose a base branch
from

Conversation

khalidM3
Copy link

No description provided.

"indent": [ "error", 2 ],
"quotes": [ "error", "single" ],
"semi": ["error", "always"],
"linebreak-style": [ "error", "unix" ]

Choose a reason for hiding this comment

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

No comma dangle. :p Boo.

@@ -0,0 +1,127 @@
# Created by https://www.gitignore.io/api/node,vim,macos,linux,windows

node_modules/

Choose a reason for hiding this comment

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

Nice job ignoring node_modules.

@@ -0,0 +1 @@
The words in the one file

Choose a reason for hiding this comment

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

This SHOULD output different buffers when you read these, but it could be a problem that all 3 of your txt files have the same first 16 characters.


const fs = require('fs');

const readFile = module.exports = function(file, callback) {

Choose a reason for hiding this comment

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

Your function needs to be able to take in all 3 files at once and read them asynchronously.

Currently, this function can only take a single file and read it.


describe('inproper file path', function(){
it('should return an error', function(done) {
readFile(`${__dirname}/fake-file.txt`, function(err){

Choose a reason for hiding this comment

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

Good test for a bad filepath.

});
});
});

Choose a reason for hiding this comment

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

Need a test to be able to read all 3 files asynchronously and return a value only if all 3 work successfully.

Currently, you do not have the logic for reading all 3 within one function call, which is an assignment requirement.

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