Skip to content

day 2 lab complete passing tests no lint issues #13

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

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