diff --git a/lab-Evan/index.js b/lab-Evan/index.js new file mode 100644 index 0000000..887f26e --- /dev/null +++ b/lab-Evan/index.js @@ -0,0 +1,9 @@ +'use strict'; + +const greet = require('./lib/greet.js'); +greet.greet('Evan'); + + +// COMMAND LINE UTILITY - EXTRA CREDIT +const clArgument = process.argv[2]; +console.log(`Hey there from the ${clArgument}`); diff --git a/lab-Evan/lib/greet.js b/lab-Evan/lib/greet.js new file mode 100644 index 0000000..3603a6b --- /dev/null +++ b/lab-Evan/lib/greet.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = exports = {}; + +exports.greet = function(name) { + console.log(`hello ${name}`); + return `hello ${name}`; +}; diff --git a/lab-Evan/test/test.js b/lab-Evan/test/test.js new file mode 100644 index 0000000..f25372d --- /dev/null +++ b/lab-Evan/test/test.js @@ -0,0 +1,13 @@ +'use strict'; + +const greet = require('../lib/greet.js'); +const assert = require('assert'); + +describe('Greet module', function() { + describe('#greet()', function() { + it('should return hey plus the name passed in', function() { + let greetingString = greet.greet('Evan'); + assert.ok(greetingString === 'hello Evan', 'string does not match hello Evan'); + }); + }); +});