Skip to content

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

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

Conversation

dkulp23
Copy link

@dkulp23 dkulp23 commented Feb 15, 2017

Added gulp file and updated testing blocks to use chai 'expect' library.

@@ -0,0 +1,117 @@
# Created by https://www.gitignore.io/api/node,vim,osx,macos,linux

*node_modules

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

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

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

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

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

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",

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

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

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

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!

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