Skip to content

Commit 28d530d

Browse files
author
Phil Sturgeon
authored
Switched from Mocha to Jest (#250)
* Switched from Mocha to Jest This will allow for mocking and spying, but I've not got around to that yet. * Dont need reftools anymore That is a dependency of oas-kit, not speccy itself. * Moved tests into a lib dir This will make room for command tests * Updated dependencies
1 parent 1d53269 commit 28d530d

27 files changed

+5423
-2149
lines changed

.circleci/config.yml

+13-8
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ version: 2.1
33
commands:
44
# Command based on instructions from CircleCI blog for avoiding fork secret leakage or failures
55
# https://circleci.com/blog/managing-secrets-when-you-have-pull-requests-from-outside-contributors/
6-
coverage:
6+
early-return-forks:
77
description: >-
8-
Report coverage, and send to Coveralls if its not a fork.
8+
If this build is from a fork, stop executing the current job and return success.
9+
This is useful to avoid steps that will fail due to missing credentials.
910
steps:
1011
- run:
11-
name: Coverage
12+
name: Early return if this build is from a forked PR
1213
command: |
1314
if [ -n "$CIRCLE_PR_NUMBER" ]; then
14-
npm run coverage
15-
else
16-
npm run coverage | coveralls
15+
echo "Nothing to do for forked PRs, so marking this step successful"
16+
circleci step halt
1717
fi
1818
1919
install-and-test:
@@ -33,8 +33,13 @@ commands:
3333
key: dependency-cache-{{ checksum "package.json" }}
3434
paths:
3535
- node_modules
36-
- run: npm test
37-
- coverage
36+
- run:
37+
name: Tests
38+
command: npx jest --ci --coverage
39+
- early-return-forks
40+
- run:
41+
name: Report Coverage
42+
command: npx coveralls < coverage/lcov.info
3843

3944
jobs:
4045
node-latest:
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)