-
Notifications
You must be signed in to change notification settings - Fork 16
Khalid lab 02 #18
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?
Khalid lab 02 #18
Conversation
"indent": [ "error", 2 ], | ||
"quotes": [ "error", "single" ], | ||
"semi": ["error", "always"], | ||
"linebreak-style": [ "error", "unix" ] |
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.
Boo. No comma dangle. :p
gulp.task('dev', function() { | ||
gulp.watch(['**/*.js', '!node_module'], ['test', 'lint']); | ||
}); | ||
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.
Nice work making your default gulp task run all of your other gulp tasks.
|
||
const greeting = require('../lab-khalid/lib/greet.js'); | ||
console.log('working'); | ||
greeting.hello(process.argv[2]); |
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 use of process.argv and passing it into the greeting module's hello method.
module.exports = exports = {}; | ||
|
||
exports.hello = function(name) { | ||
if(arguments.length === 0) throw new Error('Name not received'); |
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 conditional to determine if the name has been passed in or not.
exports.hello = function(name) { | ||
if(arguments.length === 0) throw new Error('Name not received'); | ||
console.log(name); | ||
return `Hello, ${name}!`; |
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.
String interpolation!
|
||
|
||
describe('Greeting module', function() { | ||
describe('#hello', 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 with the # before the method name inyour test describe block.
describe('#hello', function(){ | ||
it('should return hello khalid', function() { | ||
const result = greeting.hello('khalid'); | ||
expect(result).to.equal('Hello, khalid!'); |
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 test!
No description provided.