-
Notifications
You must be signed in to change notification settings - Fork 15
lab-dana #17
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?
lab-dana #17
Conversation
… and started converting tests to chai syntax.
@@ -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.
Good work ignoring node modules.
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.
Nice work writing a default gulp task to run all of your other gulp tasks. :)
|
||
const welcome = require('./lib/howdy.js'); | ||
|
||
if (process.argv.length < 3) throw new Error('please enter a 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.
Nice validation! This was a fun thing to look at when we looked at it. :D
|
||
if (process.argv.length < 3) throw new Error('please enter a name!'); | ||
|
||
if (process.argv.length === 3) welcome.greeting(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.
Cool! If the length is three, then call greet with a name passed in.
|
||
if (process.argv.length === 3) welcome.greeting(process.argv[2]); | ||
|
||
if (process.argv.length > 3) welcome.multipleGreetings(process.argv); |
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.
AWESOME job writing a method to be able to deal with multiple user inputs. 🗡
return `hello ${name}`; | ||
}; | ||
|
||
exports.multipleGreetings = function(termInput) { |
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.
Phenomenal logic here. :) Really a fan of being able to handle multiple inputs like this!
@@ -0,0 +1,33 @@ | |||
{ | |||
"name": "02-build_automation_and_dependency_management", |
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.
Could put your name in here instead.
@@ -0,0 +1,32 @@ | |||
'use strict'; | |||
|
|||
const howdy = require('../lib/howdy.js'); |
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.
Heh. Love that you named the module howdy.
describe('#greeting', function() { | ||
it(`should return hello ${process.argv[2]}`, function() { | ||
let printout = howdy.greeting(process.argv[2]); | ||
expect(howdy).to.have.property('greeting'); |
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.
Phenomenal use of different chai methods below. :) Great work!
expect(howdy).to.respondTo('multipleGreetings'); | ||
let printout = howdy.multipleGreetings(process.argv); | ||
expect(printout).to.be.a('string'); | ||
expect(printout).to.match(/^[a-zA-Z,!\s]+/); |
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 regex to ensure the validity of the user input here!
Added gulp file and updated testing blocks to use chai 'expect' library.