Skip to content

Commit

Permalink
test: refactor and test drive samples (#1028)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinBeckwith committed Mar 6, 2018
1 parent 5e8e6f4 commit 53149a1
Show file tree
Hide file tree
Showing 8 changed files with 845 additions and 1,015 deletions.
28 changes: 16 additions & 12 deletions .circleci/config.yml
Expand Up @@ -14,6 +14,20 @@ unit_tests: &unit_tests
command: node_modules/.bin/codecov
when: always

# Testing the samples requires running `npm link` and
# `npm link googleapis`, which attempts to make a global
# change. This leads to a permissions error unless the
# global npm module directory is changed. These samples
# only tested against latest LTS.
test_samples: &test_samples
steps:
- checkout
- run: npm install
- run: mkdir ~/.npm-packages
- run: echo "prefix = $HOME/.npm-packages" >> ~/.npmrc
- run: export PATH=~/.npm-packages/bin:$PATH
- run: npm run test-samples

version: 2.0
workflows:
version: 2
Expand Down Expand Up @@ -52,18 +66,7 @@ jobs:
docker:
- image: node:4
user: node
steps:
- checkout
- run:
name: Install modules and dependencies.
command: npm install --unsafe-perm
- run:
name: Run unit tests.
command: npm test
- run:
name: Submit coverage data to codecov.
command: node_modules/.bin/codecov
when: always
<<: *unit_tests
node6:
docker:
- image: node:6
Expand All @@ -74,6 +77,7 @@ jobs:
- image: node:8
user: node
<<: *unit_tests
<<: *test_samples
node9:
docker:
- image: node:9
Expand Down

0 comments on commit 53149a1

Please sign in to comment.