From a9b05a6d942546953cff9f182135a2c08780cffa Mon Sep 17 00:00:00 2001 From: Joakim Date: Tue, 29 Oct 2019 12:03:06 +0200 Subject: [PATCH] Add Coverage script and coveralls --- .travis.yml | 7 ++++++- package.json | 2 +- test/mocha.opts | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 test/mocha.opts diff --git a/.travis.yml b/.travis.yml index b8058c9..72164fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,12 @@ node_js: install: npm install script: echo "Running tests against $(node -v)..." -script: npm run test +script: npm run test:integration +script: npm run test:unit + +after_script: + - npm run coverage + - cat ./coverage/lcov.info | coveralls services: - mongodb \ No newline at end of file diff --git a/package.json b/package.json index ab092c8..df3e224 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "prepublishOnly": "npm run lint && npm run test && npm run docs", "test:integration": "isparta cover _mocha -- --opts test/integration/mocha.opts", "test:unit": "isparta cover _mocha -- --opts test/unit/mocha.opts", - "test": "npm run test:unit && npm run test:integration" + "coverage": "isparta cover _mocha -- --opts test/mocha.opts" }, "devDependencies": { "chai": "4.2.0", diff --git a/test/mocha.opts b/test/mocha.opts new file mode 100644 index 0000000..460c469 --- /dev/null +++ b/test/mocha.opts @@ -0,0 +1,5 @@ +./test/**/**/*.test.js +--recursive +--reporter spec +--timeout 2000 +--exit \ No newline at end of file