From 8a04f46e61cff6f492b2d81a20df4119834834e9 Mon Sep 17 00:00:00 2001 From: Cody McMichael Date: Fri, 31 Aug 2018 14:09:02 -0500 Subject: [PATCH 01/15] tests for ci --- testfile.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 testfile.txt diff --git a/testfile.txt b/testfile.txt new file mode 100644 index 0000000..e69de29 From a9664f82dc2a068c25f03609c8315de4845a2422 Mon Sep 17 00:00:00 2001 From: Cody McMichael Date: Fri, 31 Aug 2018 15:26:22 -0500 Subject: [PATCH 02/15] tests running tests --- .travis.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index c9dc984..a1798af 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,27 @@ -language: ruby +language: node node_js: - "7" script: echo "Running tests against $(node -v) ..." -install: "npm install" stages: - test - name: deploy if: branch = master cache: - - bundler + # - bundler - node_modules -before_script: - - bundle exec rake assets:precompile +before_install: + - nvm install node + +# before_script: +# - bundle exec rake assets:precompile test: script: npm test -deploy: - provider: heroku - api_key: - secure: $HEROKU_AUTH_TOKEN - app: validstate +# deploy: +# provider: heroku +# api_key: +# secure: $HEROKU_AUTH_TOKEN +# app: validstate From f0c1fd8616357dd1a70b7dbb0c2e6fa77b910cf5 Mon Sep 17 00:00:00 2001 From: Cody McMichael Date: Fri, 31 Aug 2018 15:28:17 -0500 Subject: [PATCH 03/15] adds right language --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a1798af..779ef8d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -language: node +language: node_js node_js: - "7" From 3cdd486be6758a426eaad51cf3b8c4a8f4bd9391 Mon Sep 17 00:00:00 2001 From: Cody McMichael Date: Fri, 31 Aug 2018 15:39:19 -0500 Subject: [PATCH 04/15] tries --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 779ef8d..84f0f82 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,8 @@ stages: - name: deploy if: branch = master cache: - # - bundler - - node_modules + directories: + - "node_modules" before_install: - nvm install node From 5555aa1a46684dbf62b2930260fe970db140f58e Mon Sep 17 00:00:00 2001 From: Cody McMichael Date: Fri, 31 Aug 2018 15:48:09 -0500 Subject: [PATCH 05/15] fixes --- .travis.yml | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/.travis.yml b/.travis.yml index 84f0f82..440a62c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,22 +6,12 @@ script: echo "Running tests against $(node -v) ..." stages: - test - - name: deploy - if: branch = master + cache: directories: - "node_modules" -before_install: - - nvm install node - -# before_script: -# - bundle exec rake assets:precompile - -test: - script: npm test -# deploy: -# provider: heroku -# api_key: -# secure: $HEROKU_AUTH_TOKEN -# app: validstate +jobs: + include: + - stage: "Tests" # naming the Tests stage + name: "Unit Tests" From 272af90a4d08fbecedded3b35947a1552accae5a Mon Sep 17 00:00:00 2001 From: Cody McMichael Date: Fri, 31 Aug 2018 15:56:42 -0500 Subject: [PATCH 06/15] test failure --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0f321c0..48766a5 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "dist/index.js", "scripts": { "build": "babel src --out-dir dist", - "test": "jest" + "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { "type": "git", From 2cce29ad3fe279ba0a2969e618b17fdd4d55fd4d Mon Sep 17 00:00:00 2001 From: Cody McMichael Date: Fri, 31 Aug 2018 15:58:31 -0500 Subject: [PATCH 07/15] reverts --- .travis.yml | 1 + package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 440a62c..ce65f7b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,3 +15,4 @@ jobs: include: - stage: "Tests" # naming the Tests stage name: "Unit Tests" + script: npm test diff --git a/package.json b/package.json index 48766a5..0f321c0 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "main": "dist/index.js", "scripts": { "build": "babel src --out-dir dist", - "test": "echo \"Error: no test specified\" && exit 1" + "test": "jest" }, "repository": { "type": "git", From 2ed281b665e2af71b105f92fe486344fca3d9199 Mon Sep 17 00:00:00 2001 From: Cody McMichael Date: Fri, 31 Aug 2018 16:03:01 -0500 Subject: [PATCH 08/15] fails test test --- tests/Validstate.test.js | 48 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/tests/Validstate.test.js b/tests/Validstate.test.js index 4e7c60a..097a839 100644 --- a/tests/Validstate.test.js +++ b/tests/Validstate.test.js @@ -12,16 +12,16 @@ beforeAll(() => { Validstate.init(validationConfig, store); actual = store.getState().validstate.account; expected = { - "email": {"message": null, "reason": null, "valid": null}, - "name": { - "firstname": {"message": null, "reason": null, "valid": null}, + "email": {"message": null, "reason": null, "valid": null}, + "name": { + "firstname": {"message": null, "reason": null, "valid": null}, "lastname": { - "maidenName": {"message": null, "reason": null, "valid": null}, "message": null, "reason": null, - "surname": {"message": null, "reason": null, "valid": null}, "valid": null}, - "message": null, "reason": null, "valid": null}, - "password": {"message": null, "reason": null, - "token": {"message": null, "reason": null, "valid": null}, - "valid": null}, + "maidenName": {"message": null, "reason": null, "valid": null}, "message": null, "reason": null, + "surname": {"message": null, "reason": null, "valid": null}, "valid": null}, + "message": null, "reason": null, "valid": null}, + "password": {"message": null, "reason": null, + "token": {"message": null, "reason": null, "valid": null}, + "valid": null}, "valid": null } }); @@ -50,16 +50,16 @@ describe('Validstate', () => { // TODO change this whenever messages are extended into nested properties. // Currently if a property is nested then the parent property will have null values except for `valid` expected = { - "email": {"message": "Email must be formatted as an email.", "reason": "email", "valid": false}, - "name": { - "firstname": {"message": null, "reason": "required", "valid": false}, + "email": {"message": "Email must be formatted as an email.", "reason": "email", "valid": false}, + "name": { + "firstname": {"message": null, "reason": "required", "valid": false}, "message": null, "reason": null, "valid": false - }, + }, "password": { - "message": null, "reason": null, - "token": {"message": null, "reason": "minLength", "valid": false}, + "message": null, "reason": null, + "token": {"message": null, "reason": "minLength", "valid": false}, "valid": false - }, + }, "valid": false } }); @@ -67,7 +67,7 @@ describe('Validstate', () => { it('Invalidates `account` validation correctly', () => { const actual = store.getState().validstate.account; // Validation - expect(actual.valid).toBe(false); + expect(actual.valid).toBe(true); // Single property expect(actual.email).toEqual(expected.email); @@ -86,16 +86,16 @@ describe('Validstate', () => { Validstate.validate('account'); expected = { - "email": {"message": null, "reason": null, "valid": true}, - "name": { - "firstname": {"message": null, "reason": null, "valid": true}, + "email": {"message": null, "reason": null, "valid": true}, + "name": { + "firstname": {"message": null, "reason": null, "valid": true}, "message": null, "reason": null, "valid": true - }, + }, "password": { - "message": null, "reason": null, - "token": {"message": null, "reason": null, "valid": true}, + "message": null, "reason": null, + "token": {"message": null, "reason": null, "valid": true}, "valid": true - }, + }, "valid": true } }); From 2e48fdf6bad7327aa502f857855ed23c6e7abc4c Mon Sep 17 00:00:00 2001 From: Cody McMichael Date: Fri, 31 Aug 2018 16:23:23 -0500 Subject: [PATCH 09/15] playing with configs --- .travis.yml | 11 ++++++++++- testfile.txt | 0 2 files changed, 10 insertions(+), 1 deletion(-) delete mode 100644 testfile.txt diff --git a/.travis.yml b/.travis.yml index ce65f7b..a40fe1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ script: echo "Running tests against $(node -v) ..." stages: - test + - release to npm cache: directories: @@ -13,6 +14,14 @@ cache: jobs: include: - - stage: "Tests" # naming the Tests stage + - stage: "Tests" name: "Unit Tests" script: npm test + name: "Just Tests" + script: echo "Testing this out" + release to npm: + name: "NPM Release" + script: echo "Build release" + # provider: npm + # email: "YOUR_EMAIL_ADDRESS" + # api_key: "YOUR_AUTH_TOKEN" diff --git a/testfile.txt b/testfile.txt deleted file mode 100644 index e69de29..0000000 From 57bffe79d385a6317c9aa6f22c868f444ee2225f Mon Sep 17 00:00:00 2001 From: Cody McMichael Date: Fri, 31 Aug 2018 16:24:57 -0500 Subject: [PATCH 10/15] test --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a40fe1b..1b06e9b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,9 +19,9 @@ jobs: script: npm test name: "Just Tests" script: echo "Testing this out" - release to npm: - name: "NPM Release" - script: echo "Build release" + # release to npm: + # name: "NPM Release" + # script: echo "Build release" # provider: npm # email: "YOUR_EMAIL_ADDRESS" # api_key: "YOUR_AUTH_TOKEN" From 371c76993ff902e511cbef9f7130612e06de1e98 Mon Sep 17 00:00:00 2001 From: Cody McMichael Date: Fri, 31 Aug 2018 16:27:41 -0500 Subject: [PATCH 11/15] more tests --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1b06e9b..2aa459c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,9 +19,10 @@ jobs: script: npm test name: "Just Tests" script: echo "Testing this out" - # release to npm: - # name: "NPM Release" - # script: echo "Build release" + - stage: release to npm + name: "NPM Release" + script: echo "Build release" + script: 'curl http://validstate.herokuapp.com' # provider: npm # email: "YOUR_EMAIL_ADDRESS" # api_key: "YOUR_AUTH_TOKEN" From 4b255e76b21b2919835782436fa7195e41e43730 Mon Sep 17 00:00:00 2001 From: Cody McMichael Date: Fri, 31 Aug 2018 16:35:27 -0500 Subject: [PATCH 12/15] more tetsting --- .travis.yml | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2aa459c..7a1d6b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,7 @@ node_js: script: echo "Running tests against $(node -v) ..." stages: - - test - - release to npm + - GitHub Release cache: directories: @@ -14,15 +13,21 @@ cache: jobs: include: - - stage: "Tests" - name: "Unit Tests" - script: npm test - name: "Just Tests" - script: echo "Testing this out" - - stage: release to npm - name: "NPM Release" - script: echo "Build release" - script: 'curl http://validstate.herokuapp.com' + - script: echo "Running unit tests (1)" + - script: echo "Running unit tests (2)" + - stage: GitHub Release + script: echo "Deploying to GitHub releases ..." + +# jobs: +# include: +# - stage: "Tests" +# name: "Unit Tests" +# script: npm test +# name: "Just Tests" +# script: echo "Testing this out" +# - stage: release to npm +# name: "NPM Release" +# script: echo "Build release" # provider: npm # email: "YOUR_EMAIL_ADDRESS" # api_key: "YOUR_AUTH_TOKEN" From b2fe262aee3b3bf45a9f4a21060437964b09fc38 Mon Sep 17 00:00:00 2001 From: Cody McMichael Date: Fri, 31 Aug 2018 16:51:15 -0500 Subject: [PATCH 13/15] testing 123 --- .travis.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7a1d6b3..bce5299 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,10 @@ node_js: script: echo "Running tests against $(node -v) ..." stages: - - GitHub Release + - compile + - test + - name: npm release + if: branch = master cache: directories: @@ -15,8 +18,14 @@ jobs: include: - script: echo "Running unit tests (1)" - script: echo "Running unit tests (2)" - - stage: GitHub Release - script: echo "Deploying to GitHub releases ..." + - stage: compile + name: "NPM Compile" + script: echo "Compile Package" + - stage: npm release + script: echo "Deploying to npm ..." + deploy: + provider: npm + api_key: "$NPM_API_KEY" # jobs: # include: From 471c9190eaa55494def4ce27606343b93e26796f Mon Sep 17 00:00:00 2001 From: Cody McMichael Date: Tue, 4 Sep 2018 09:32:12 -0500 Subject: [PATCH 14/15] preps actual CI file --- .travis.yml | 42 +++++++++++++++--------------------------- 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index bce5299..62433de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,9 @@ node_js: script: echo "Running tests against $(node -v) ..." stages: - - compile - test - - name: npm release - if: branch = master + # - name: npm release + # if: branch = master cache: directories: @@ -16,27 +15,16 @@ cache: jobs: include: - - script: echo "Running unit tests (1)" - - script: echo "Running unit tests (2)" - - stage: compile - name: "NPM Compile" - script: echo "Compile Package" - - stage: npm release - script: echo "Deploying to npm ..." - deploy: - provider: npm - api_key: "$NPM_API_KEY" - -# jobs: -# include: -# - stage: "Tests" -# name: "Unit Tests" -# script: npm test -# name: "Just Tests" -# script: echo "Testing this out" -# - stage: release to npm -# name: "NPM Release" -# script: echo "Build release" - # provider: npm - # email: "YOUR_EMAIL_ADDRESS" - # api_key: "YOUR_AUTH_TOKEN" + - stage: test + name: "Unit Tests" + script: npm test + # Save for later in case we want to add this in +# - stage: npm release +# script: echo "Building distrubtion ..." && npm build +# script: echo "Deploying to npm ..." +# deploy: +# provider: npm +# api_key: "$NPM_API_KEY" +# on: +# tags: true +# skip_cleanup: true From 9b8859278f2e3ff97a755a7dc96c41f22cf72911 Mon Sep 17 00:00:00 2001 From: Cody McMichael Date: Tue, 4 Sep 2018 09:35:25 -0500 Subject: [PATCH 15/15] Gets test to pass --- tests/Validstate.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Validstate.test.js b/tests/Validstate.test.js index 097a839..c300214 100644 --- a/tests/Validstate.test.js +++ b/tests/Validstate.test.js @@ -67,7 +67,7 @@ describe('Validstate', () => { it('Invalidates `account` validation correctly', () => { const actual = store.getState().validstate.account; // Validation - expect(actual.valid).toBe(true); + expect(actual.valid).toBe(false); // Single property expect(actual.email).toEqual(expected.email);