From 01d57101f78fd1248daff343689b0ace94e2f061 Mon Sep 17 00:00:00 2001 From: Bessie Arino Date: Mon, 12 Feb 2018 12:38:35 -0800 Subject: [PATCH 1/4] completed config --- lab-bessie/.eslintignore | 5 ++ lab-bessie/.eslintrc.json | 27 +++++++ lab-bessie/.gitignore | 145 ++++++++++++++++++++++++++++++++++++++ lab-bessie/README.md | 0 4 files changed, 177 insertions(+) create mode 100644 lab-bessie/.eslintignore create mode 100644 lab-bessie/.eslintrc.json create mode 100644 lab-bessie/.gitignore create mode 100644 lab-bessie/README.md diff --git a/lab-bessie/.eslintignore b/lab-bessie/.eslintignore new file mode 100644 index 0000000..82ff623 --- /dev/null +++ b/lab-bessie/.eslintignore @@ -0,0 +1,5 @@ +**/node_modules/* +**/vendor/* +**/*.min.js +**/coverage/* +**/build/* \ No newline at end of file diff --git a/lab-bessie/.eslintrc.json b/lab-bessie/.eslintrc.json new file mode 100644 index 0000000..3fe56a5 --- /dev/null +++ b/lab-bessie/.eslintrc.json @@ -0,0 +1,27 @@ +{ + "env": { + "browser": true, + "node": true, + "commonjs": true, + "jest": true, + "es6": true + }, + "globals": { + "err": true, + "req": true, + "res": true, + "next": true + }, + "extends": "eslint:recommended", + "parserOptions": { + "sourceType": "module" + }, + "rules": { + "no-console": "off", + "indent": [ "error", 2 ], + "quotes": ["error", "single", { "allowTemplateLiterals": true }], + "comma-dangle": ["error", "always-multiline"], + "semi": [ "error", "always" ], + "linebreak-style": ["error", "unix"] + } + } \ No newline at end of file diff --git a/lab-bessie/.gitignore b/lab-bessie/.gitignore new file mode 100644 index 0000000..e24c600 --- /dev/null +++ b/lab-bessie/.gitignore @@ -0,0 +1,145 @@ +# 401 JS +db +**.env +temp +build + +# Created by https://www.gitignore.io/api/vim,osx,node,linux,windows +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Typescript v1 declaration files +typings/ + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env + + +### OSX ### +*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Vim ### +# swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-v][a-z] +[._]sw[a-p] +# session +Session.vim +# temporary +.netrwhist +# auto-generated tag files +tags + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.gitignore.io/api/vim,osx,node,linux,windows \ No newline at end of file diff --git a/lab-bessie/README.md b/lab-bessie/README.md new file mode 100644 index 0000000..e69de29 From b598b3d57bde3bc26cb56dd7fd9da0844e1591e9 Mon Sep 17 00:00:00 2001 From: Bessie Arino Date: Mon, 12 Feb 2018 15:12:38 -0800 Subject: [PATCH 2/4] completed lab --- lab-bessie/README.md | 5 +++++ lab-bessie/lib/arithmatic.js | 17 +++++++++++++++++ lab-bessie/lib/greet.js | 8 ++++++++ lab-bessie/test/arithmatic-test.js | 28 ++++++++++++++++++++++++++++ lab-bessie/test/greet-test.js | 17 +++++++++++++++++ 5 files changed, 75 insertions(+) create mode 100644 lab-bessie/lib/arithmatic.js create mode 100644 lab-bessie/lib/greet.js create mode 100644 lab-bessie/test/arithmatic-test.js create mode 100644 lab-bessie/test/greet-test.js diff --git a/lab-bessie/README.md b/lab-bessie/README.md index e69de29..50bc8b0 100644 --- a/lab-bessie/README.md +++ b/lab-bessie/README.md @@ -0,0 +1,5 @@ +* In greet.js the single function is export a function that has an airity of 1 and expects a string as its input. If the input is valid, it will return a message saying 'hello [value of input]'. If the input is not valid, it will return null. + +* In arithmatic.js, one function that is exported is add which has an airity of 2. It expects two numbers as the inputs. If it is valid, it will return the sum of the two numbers. If one or both inputs are not numbers, it will return null. + +* The other function in arithmatic.js is sub which has an airity of 2. It expects two numbers as inputs. If the inputs are valid, it will return the difference between the two numbers. If one or both inputs are not numbers, it will return null. \ No newline at end of file diff --git a/lab-bessie/lib/arithmatic.js b/lab-bessie/lib/arithmatic.js new file mode 100644 index 0000000..152791a --- /dev/null +++ b/lab-bessie/lib/arithmatic.js @@ -0,0 +1,17 @@ +'use strict'; + +module.exports = exports = {}; + +exports.add = function(a, b) { + if(typeof a !== 'number' || typeof b !== 'number') { + return null; + }; + return a + b; +}; + +exports.sub = function(a, b) { + if(typeof a !== 'number' || typeof b !== 'number') { + return null; + }; + return b - a; +}; \ No newline at end of file diff --git a/lab-bessie/lib/greet.js b/lab-bessie/lib/greet.js new file mode 100644 index 0000000..173de5b --- /dev/null +++ b/lab-bessie/lib/greet.js @@ -0,0 +1,8 @@ +'use strict'; + +module.exports = function(name) { + if(typeof name !== 'string') { + return null; + }; + return `hello ${name}`; +}; \ No newline at end of file diff --git a/lab-bessie/test/arithmatic-test.js b/lab-bessie/test/arithmatic-test.js new file mode 100644 index 0000000..42f4ab4 --- /dev/null +++ b/lab-bessie/test/arithmatic-test.js @@ -0,0 +1,28 @@ +'use strict'; + +const arithmatic = require('../lib/arithmatic.js'); +const assert = require('assert'); + +describe('Arithmatic Module', function() { + describe('#add', function() { + it('should equal 15',function() { + var result = arithmatic.add(7,8); + assert.ok(result === 15, 'does not equal 15'); + }); + it('should return null', function() { + var result = arithmatic.add(8, 'hello'); + assert.ok(result === null, 'then they should both be numbers'); + }); + }); + + describe('#sub', function() { + it('should equal 2', function() { + var result = arithmatic.sub(13, 15); + assert.ok(result === 2, 'does not equal 2'); + }); + it('should return null', function() { + var result = arithmatic.sub(15, 'hello'); + assert.ok(result === null, 'then they should both be numbers'); + }) + }) +}); \ No newline at end of file diff --git a/lab-bessie/test/greet-test.js b/lab-bessie/test/greet-test.js new file mode 100644 index 0000000..de5e20f --- /dev/null +++ b/lab-bessie/test/greet-test.js @@ -0,0 +1,17 @@ +'use strict'; + +const greet = require('../lib/greet.js'); +const assert = require('assert'); + +describe('Greet Module', function() { + describe('#greet', function() { + it('should say hello world', function() { + var result = greet('world'); + assert.ok(result === 'hello world', 'not equal to hello world'); + }); + it('should say null', function(){ + var result = greet(88); + assert.ok(result === null, 'result not null'); + }); + }); +}); \ No newline at end of file From cc3fbcd0780dd14460bad8ccf37a3bccd1dc2679 Mon Sep 17 00:00:00 2001 From: Bessie Arino Date: Tue, 13 Feb 2018 09:13:07 -0800 Subject: [PATCH 3/4] fixed tabs --- lab-bessie/lib/arithmatic.js | 16 ++++++------- lab-bessie/lib/greet.js | 10 ++++---- lab-bessie/test/arithmatic-test.js | 38 +++++++++++++++--------------- lab-bessie/test/greet-test.js | 18 +++++++------- 4 files changed, 41 insertions(+), 41 deletions(-) diff --git a/lab-bessie/lib/arithmatic.js b/lab-bessie/lib/arithmatic.js index 152791a..0357930 100644 --- a/lab-bessie/lib/arithmatic.js +++ b/lab-bessie/lib/arithmatic.js @@ -3,15 +3,15 @@ module.exports = exports = {}; exports.add = function(a, b) { - if(typeof a !== 'number' || typeof b !== 'number') { - return null; - }; - return a + b; + if(typeof a !== 'number' || typeof b !== 'number') { + return null; + }; + return a + b; }; exports.sub = function(a, b) { - if(typeof a !== 'number' || typeof b !== 'number') { - return null; - }; - return b - a; + if(typeof a !== 'number' || typeof b !== 'number') { + return null; + }; + return b - a; }; \ No newline at end of file diff --git a/lab-bessie/lib/greet.js b/lab-bessie/lib/greet.js index 173de5b..4bbc496 100644 --- a/lab-bessie/lib/greet.js +++ b/lab-bessie/lib/greet.js @@ -1,8 +1,8 @@ 'use strict'; module.exports = function(name) { - if(typeof name !== 'string') { - return null; - }; - return `hello ${name}`; -}; \ No newline at end of file + if(typeof name !== 'string') { + return null; + }; + return `hello ${name}`; +}; \ No newline at end of file diff --git a/lab-bessie/test/arithmatic-test.js b/lab-bessie/test/arithmatic-test.js index 42f4ab4..b545e61 100644 --- a/lab-bessie/test/arithmatic-test.js +++ b/lab-bessie/test/arithmatic-test.js @@ -4,25 +4,25 @@ const arithmatic = require('../lib/arithmatic.js'); const assert = require('assert'); describe('Arithmatic Module', function() { - describe('#add', function() { - it('should equal 15',function() { - var result = arithmatic.add(7,8); - assert.ok(result === 15, 'does not equal 15'); - }); - it('should return null', function() { - var result = arithmatic.add(8, 'hello'); - assert.ok(result === null, 'then they should both be numbers'); - }); + describe('#add', function() { + it('should equal 15',function() { + var result = arithmatic.add(7,8); + assert.ok(result === 15, 'does not equal 15'); }); + it('should return null', function() { + var result = arithmatic.add(8, 'hello'); + assert.ok(result === null, 'then they should both be numbers'); + }); + }); - describe('#sub', function() { - it('should equal 2', function() { - var result = arithmatic.sub(13, 15); - assert.ok(result === 2, 'does not equal 2'); - }); - it('should return null', function() { - var result = arithmatic.sub(15, 'hello'); - assert.ok(result === null, 'then they should both be numbers'); - }) - }) + describe('#sub', function() { + it('should equal 2', function() { + var result = arithmatic.sub(13, 15); + assert.ok(result === 2, 'does not equal 2'); + }); + it('should return null', function() { + var result = arithmatic.sub(15, 'hello'); + assert.ok(result === null, 'then they should both be numbers'); + }); + }); }); \ No newline at end of file diff --git a/lab-bessie/test/greet-test.js b/lab-bessie/test/greet-test.js index de5e20f..cd0b79c 100644 --- a/lab-bessie/test/greet-test.js +++ b/lab-bessie/test/greet-test.js @@ -4,14 +4,14 @@ const greet = require('../lib/greet.js'); const assert = require('assert'); describe('Greet Module', function() { - describe('#greet', function() { - it('should say hello world', function() { - var result = greet('world'); - assert.ok(result === 'hello world', 'not equal to hello world'); - }); - it('should say null', function(){ - var result = greet(88); - assert.ok(result === null, 'result not null'); - }); + describe('#greet', function() { + it('should say hello world', function() { + var result = greet('world'); + assert.ok(result === 'hello world', 'not equal to hello world'); }); + it('should say null', function(){ + var result = greet(88); + assert.ok(result === null, 'result not null'); + }); + }); }); \ No newline at end of file From 42132384ef8244744aaafe6d5a5a559f89cff9d7 Mon Sep 17 00:00:00 2001 From: Bessie Arino Date: Tue, 13 Feb 2018 11:10:25 -0800 Subject: [PATCH 4/4] removed extra semi colons --- lab-bessie/lib/arithmatic.js | 4 ++-- lab-bessie/lib/greet.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lab-bessie/lib/arithmatic.js b/lab-bessie/lib/arithmatic.js index 0357930..84dc0b4 100644 --- a/lab-bessie/lib/arithmatic.js +++ b/lab-bessie/lib/arithmatic.js @@ -5,13 +5,13 @@ module.exports = exports = {}; exports.add = function(a, b) { if(typeof a !== 'number' || typeof b !== 'number') { return null; - }; + } return a + b; }; exports.sub = function(a, b) { if(typeof a !== 'number' || typeof b !== 'number') { return null; - }; + } return b - a; }; \ No newline at end of file diff --git a/lab-bessie/lib/greet.js b/lab-bessie/lib/greet.js index 4bbc496..7c22890 100644 --- a/lab-bessie/lib/greet.js +++ b/lab-bessie/lib/greet.js @@ -3,6 +3,6 @@ module.exports = function(name) { if(typeof name !== 'string') { return null; - }; + } return `hello ${name}`; }; \ No newline at end of file