Skip to content

Commit

Permalink
test: full coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
James Zetlen committed Jan 30, 2020
1 parent a7eb4fa commit 4d5818a
Show file tree
Hide file tree
Showing 36 changed files with 7,715 additions and 2,760 deletions.
44 changes: 44 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# https://circleci.com/docs/2.0/language-javascript/
version: 2
jobs:
'node-10':
docker:
- image: circleci/node:10
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: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run: npm test
- run: npm run cov:send
'node-latest':
docker:
- image: circleci/node:latest
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
- v1-dependencies-
- run: npm install
- save_cache:
paths:
- node_modules
key: v1-dependencies-{{ checksum "package.json" }}
- run: npm test
- run: npm run cov:send

workflows:
version: 2
build:
jobs:
- 'node-10'
- 'node-latest'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
node_modules
!src/__tests__/**/node_modules
build
test
src/**.js
Expand Down
7 changes: 2 additions & 5 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
src
test
src/__tests__
tsconfig.json
tsconfig.module.json
tslint.json
.travis.yml
.circle
.github
.prettierignore
.vscode
build/docs
**/*.spec.*
coverage
.nyc_output
*.log
20 changes: 20 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
verbose: true,
bail: true,
collectCoverage: true,
collectCoverageFrom: ['./src/*.ts'],
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100
}
},
moduleFileExtensions: ['ts', 'tsx', 'js', 'json', 'jsx', 'node'],
moduleDirectories: ['node_modules', 'src/__tests__/__fixtures__'],
testEnvironment: 'node',
testMatch: ['**/__tests__/*.ts'],
testPathIgnorePatterns: ['.d.ts']
};

0 comments on commit 4d5818a

Please sign in to comment.