Skip to content

Commit

Permalink
chore(quality): set up CodeClimate quality/coverage monitoring
Browse files Browse the repository at this point in the history
  • Loading branch information
tdd committed Oct 1, 2018
1 parent 7383b96 commit e4217f4
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,2 +1,3 @@
node_modules
cc-test-reporter
coverage
node_modules
9 changes: 9 additions & 0 deletions .travis.yml
@@ -1,10 +1,19 @@
env:
global:
- CC_TEST_REPORTER_ID=a74ee4ef543d01477e97d00b6f2b12d082d113152766905d0e86842d06bc3815
language: node_js
node_js:
- 8
- 9
- 10
before_install:
- npm install --global npm@6
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
after_script:
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
cache:
directories:
- node_modules
6 changes: 2 additions & 4 deletions README.md
Expand Up @@ -3,14 +3,12 @@
[![npm version](https://badge.fury.io/js/mongoose-pii.svg)](https://npmjs.com/package/mongoose-pii)
[![MIT license](https://img.shields.io/github/license/deliciousinsights/mongoose-pii.svg)](https://en.wikipedia.org/wiki/MIT_License)
[![Travis build](https://img.shields.io/travis/deliciousinsights/mongoose-pii.svg)](https://travis-ci.org/deliciousinsights/mongoose-pii)

<!-- Here, once set up, CodeClimate coverage badge -->
[![CodeClimate Code Coverage score](https://img.shields.io/codeclimate/coverage/deliciousinsights/mongoose-pii.svg)](https://codeclimate.com/github/deliciousinsights/mongoose-pii)

![Dependencies freshness](https://img.shields.io/david/deliciousinsights/mongoose-pii.svg)
[![Greenkeeper badge](https://badges.greenkeeper.io/deliciousinsights/mongoose-pii.svg)](https://greenkeeper.io/)

<!-- Here, once set up, CodeClimate quality badge -->

[![CodeClimate maintainability score](https://img.shields.io/codeclimate/maintainability/deliciousinsights/mongoose-pii.svg)](https://codeclimate.com/github/deliciousinsights/mongoose-pii)
[![Coding style is StandardJS-based](https://img.shields.io/badge/style-standard-brightgreen.svg)](https://standardjs.com/)
[![Code of Conduct is Contributor Covenant](https://img.shields.io/badge/code%20of%20conduct-contributor%20covenant-brightgreen.svg)](http://contributor-covenant.org/version/1/4/)

Expand Down
17 changes: 17 additions & 0 deletions index.spec.js
@@ -0,0 +1,17 @@
describe('Top-level module', () => {
it('should re-export all the useful methods', () => {
const {
checkPassword,
cipher,
decipher,
hashPassword,
markFieldsAsPII,
} = require('./index')

expect(checkPassword).toBeInstanceOf(Function)
expect(cipher).toBeInstanceOf(Function)
expect(decipher).toBeInstanceOf(Function)
expect(hashPassword).toBeInstanceOf(Function)
expect(markFieldsAsPII).toBeInstanceOf(Function)
})
})
10 changes: 10 additions & 0 deletions package.json
Expand Up @@ -38,6 +38,16 @@
"homepage": "https://github.com/deliciousinsights/mongoose-pii#readme",
"license": "MIT",
"jest": {
"collectCoverage": true,
"collectCoverageFrom": [
"<rootDir>/*.js",
"<rootDir>/util/*.js"
],
"coverageReporters": [
"lcov",
"text",
"html"
],
"notify": true,
"testEnvironment": "node"
},
Expand Down

0 comments on commit e4217f4

Please sign in to comment.