Skip to content

lab-remil#6

Open
remilonwheels wants to merge 3 commits intocodefellows-javascript-401d13:masterfrom
remilonwheels:master
Open

lab-remil#6
remilonwheels wants to merge 3 commits intocodefellows-javascript-401d13:masterfrom
remilonwheels:master

Conversation

@remilonwheels
Copy link

[x] For this assignment you will need to read three files and console log the first 8 bytes (in hex) of each file.

[x] Regardless of file size, all three files should be read and logged in the order 'one.txt', 'two.txt', 'three.txt'.

[x] You will need to include tests that guarantee that the files are logged in the proper order.

[x] You will also need to include tests that check for improper file paths.

"quotes": [ "error", "single" ],
"semi": ["error", "always"],
"linebreak-style": [ "error", "windows" ],
"comma-dangle": ["error", "always-multiline"]

Choose a reason for hiding this comment

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

YEAH TEAM COMMA DANGLE! WHOO!

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

*node_modules

Choose a reason for hiding this comment

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

Nice work ignoring node modules.

@@ -0,0 +1 @@
All hail the redskins!!!

Choose a reason for hiding this comment

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

Nope.

@@ -0,0 +1 @@
The doppity doppest doptacular dopeness eva

Choose a reason for hiding this comment

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

Dope.

gulp.watch(['**/*.js', '!node_modules/**'], ['lint', 'test']);
});

gulp.task('default', ['dev']);

Choose a reason for hiding this comment

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

Nice work setting your default gulp task to run all of your other gulp tasks.

return bufferObj.toString('hex', 0, 8);
};

for(let i=0; i < files.length; i++) {

Choose a reason for hiding this comment

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

Typically you want a space around the = in your first for loop argument.

e.g. i = 0 is cleaner and a bit more "conventional".

if (resultArray.filter(function(file){
return Object.keys(file).includes('result');
}).length === files.length) {
return callback(null, resultArray);

Choose a reason for hiding this comment

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

Perfect use of the callback here.

describe('FileLogger Module', function() {
describe('with an improper file path', function(){
it('should return an error', function(done) {
let badFilePath = 'badfile/sobad';

Choose a reason for hiding this comment

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

Good test. Sobad.

fileLogger(input , function(err, data) {
expect(err).to.equal(null);
expect(data).to.be.an('array');
expect(data.length).to.equal(input.length);

Choose a reason for hiding this comment

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

Cool. Yup, our output array's length should be the same. Good length.

});
});
});
});

Choose a reason for hiding this comment

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

Lots of tests. Radical!

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