Skip to content

Conversation

brials
Copy link

@brials brials commented Feb 15, 2017

No description provided.

@@ -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 your node modules folder.

const eslint = require('gulp-eslint');
const mocha = require('gulp-mocha');

gulp.task('test', function(){

Choose a reason for hiding this comment

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

Good gulp task!


gulp.task('test', function(){
gulp.src('./test/*-test.js', {read: false})
.pipe(mocha({reporter:'nyan'}));

Choose a reason for hiding this comment

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

Yeeeeaaahhhh! Nyan Cat ftw!

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.

Good use of the default gulp task here running everything else!


const greet = require('./lib/greet.js');

greet.sayHello('Brian');

Choose a reason for hiding this comment

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

Good modularized pattern. :)

"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {

Choose a reason for hiding this comment

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

Good dev dependencies.

const expect = require('chai').expect;

describe('Greet Module', function(){
describe('#sayHello', function(){

Choose a reason for hiding this comment

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

Nice work naming the method with the # before the name of the method.

describe('Greet Module', function(){
describe('#sayHello', function(){
it('should return a string of hey name', function(){
var result = greet.sayHello('brian');

Choose a reason for hiding this comment

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

Good work storing the value of the method call in a variable to more cleanly reference it in your test below!

expect(result).to.throw(Error);
});
});
describe('#sayGoodBye', function(){

Choose a reason for hiding this comment

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

Great testing. :)

});
it('should throw a missing name error', function(){
var result = greet.sayHello;
expect(result).to.throw(Error);

Choose a reason for hiding this comment

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

Nice using the .to.throw syntax!

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