Skip to content

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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