From c4e38216fca63d8245eebb2d94f7d90f14c346d3 Mon Sep 17 00:00:00 2001 From: Evan Paige Date: Mon, 5 Dec 2016 20:20:15 -0800 Subject: [PATCH] pushing up my completed lab --- lab-Evan/index.js | 9 +++++++++ lab-Evan/lib/greet.js | 8 ++++++++ lab-Evan/test/test.js | 13 +++++++++++++ 3 files changed, 30 insertions(+) create mode 100644 lab-Evan/index.js create mode 100644 lab-Evan/lib/greet.js create mode 100644 lab-Evan/test/test.js 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'); + }); + }); +});