From 9b43487a19212c54bce9183dd05916ea46d7d6dd Mon Sep 17 00:00:00 2001 From: Daniel Rubio Date: Mon, 26 Feb 2018 10:50:59 -0800 Subject: [PATCH 1/4] assigned proper lenght for genLoopIndex --- src/tool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tool.js b/src/tool.js index 0997882..1fbfb47 100644 --- a/src/tool.js +++ b/src/tool.js @@ -2,7 +2,7 @@ exports.genURL = (urlLength) => { var urlString = ""; const sourceLetters = "ABCDEFGHJKMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz23456789"; - for(var genLoopIndex = 0; genLoopIndex < 50; genLoopIndex++){ + for (var genLoopIndex = 0; genLoopIndex < 150; genLoopIndex++) { // Add a random letter to the urlString urlString += sourceLetters.charAt(Math.random() * (sourceLetters.length - 1)) From a33827820c29cd92f00e706bab369b4a37947683 Mon Sep 17 00:00:00 2001 From: Daniel Rubio Date: Fri, 2 Mar 2018 08:56:51 -0800 Subject: [PATCH 2/4] added circleci config file --- .circleci/config.yml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..ca093f1 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,39 @@ +# Javascript Node CircleCI 2.0 configuration file +# +# Check https://circleci.com/docs/2.0/language-javascript/ for more details +# +version: 2 +jobs: + build: + docker: + # specify the version you desire here + - image: circleci/node:7.10 + + # Specify service dependencies here if necessary + # CircleCI maintains a library of pre-built images + # documented at https://circleci.com/docs/2.0/circleci-images/ + # - image: circleci/mongo:3.4.4 + + working_directory: ~/repo + + steps: + - checkout + + # Download and cache dependencies + - restore_cache: + keys: + - v1-dependencies-{{ checksum "package.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + + - run: yarn install + + - save_cache: + paths: + - node_modules + key: v1-dependencies-{{ checksum "package.json" }} + + # run tests! + - run: yarn test + + From 1c83cf58f68af4363a3ec57a7d8750626f9b1dad Mon Sep 17 00:00:00 2001 From: Daniel Rubio Date: Fri, 2 Mar 2018 08:59:45 -0800 Subject: [PATCH 3/4] specified npm test --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 079a25e..5eb2aa5 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "src/tool.js", "scripts": { "start": "node src/server.js", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "mocha" }, "author": "chapman", "license": "ISC", @@ -15,4 +15,4 @@ "devDependencies": { "chai": "^3.5.0" } -} +} \ No newline at end of file From eb63f48143cefe0a4b168d8cc06f0def06b0fea7 Mon Sep 17 00:00:00 2001 From: Daniel Rubio Date: Fri, 2 Mar 2018 09:05:54 -0800 Subject: [PATCH 4/4] added mocha for testing --- package.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 5eb2aa5..188175e 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "src/tool.js", "scripts": { "start": "node src/server.js", - "test": "mocha" + "test": "./node_modules/mocha/bin/mocha" }, "author": "chapman", "license": "ISC", @@ -13,6 +13,7 @@ "express": "^4.15.3" }, "devDependencies": { - "chai": "^3.5.0" + "chai": "^3.5.0", + "mocha": "^5.0.1" } -} \ No newline at end of file +}