-
Notifications
You must be signed in to change notification settings - Fork 15
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
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,117 @@ | |||
# Created by https://www.gitignore.io/api/node,vim,osx,macos,linux | |||
|
|||
*node_modules |
There was a problem hiding this comment.
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(){ |
There was a problem hiding this comment.
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'})); |
There was a problem hiding this comment.
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']); |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
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(){ |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
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(){ |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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!
No description provided.