Skip to content

Conversation

khalidM3
Copy link

No description provided.

"indent": [ "error", 2 ],
"quotes": [ "error", "single" ],
"semi": ["error", "always"],
"linebreak-style": [ "error", "unix" ]

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']);

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]);

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');

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}!`;

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(){

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!');

Choose a reason for hiding this comment

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

Good test!

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