Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tests #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions .circleci/config.yaml

This file was deleted.

88 changes: 88 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
defaults: &defaults
docker:
- image: circleci/node:8.11.1
working_directory: ~/tmp/circlci-now

version: 2
jobs:
checkout:
<<: *defaults
steps:
- checkout
- attach_workspace:
at: ~/tmp/circlci-now
- restore_cache:
keys:
- npm-cache-{{ .Branch }}-{{ checksum "package.json" }}
- npm-cache-{{ .Branch }}
- npm-cache-
- run:
name: "Checking Versions"
command: |
node --version
npm --version
- run:
name: NPM Install
command: npm install
- save_cache:
key: npm-cache-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- node_modules
- persist_to_workspace:
root: .
paths: .
unit-test:
<<: *defaults
steps:
- attach_workspace:
at: ~/tmp/circlci-now
- run:
name: NPM Install
command: npm install
- run:
name: Unit Test
command: npm run test
deploy:
<<: *defaults
steps:
- attach_workspace:
at: ~/tmp/circlci-now
- run:
name: Install Now CLI
command: sudo npm install --global --unsafe-perm now
- deploy:
name: Deploy & Alias
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
now --token $ZEIT_TOKEN --local-config .now/now.production.json
now --token $ZEIT_TOKEN --local-config .now/now.production.json alias
elif [ "${CIRCLE_BRANCH}" == "develop" ]; then
now --token $ZEIT_TOKEN --local-config .now/now.staging.json
now --token $ZEIT_TOKEN --local-config .now/now.staging.json alias
else
./.now/now.feature.sh
now --token $ZEIT_TOKEN --local-config .now/now.feature.json
now --token $ZEIT_TOKEN --local-config .now/now.feature.json alias
fi
workflows:
version: 2
build:
jobs:
- checkout
- unit-test:
requires:
- checkout
deploy:
jobs:
- unit-test:
filters:
branches:
only: master
requires:
- checkout
- deploy:
filters:
branches:
only: master
requires:
- unit-test
2 changes: 1 addition & 1 deletion test/db/grants.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const testData = require('../_testData');
// });

test('Create and read grant', t => {
t.true(1===1);
t.true(2===2);
// grants.upsert(testData.client, testData.user, 'userinfo', function(err, grant) {
// t.true(grant.client_id === testData.client.client_id, 'Client id matches');

Expand Down