diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..8639755 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,37 @@ +# 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:6.6 + + # 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: ~/urlShortner + + 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 diff --git a/package.json b/package.json index 079a25e..1699682 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", diff --git a/src/tool.js b/src/tool.js index 0997882..bf7b406 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))