From f6b1a61f9cddaea099446868563049f6e0471e6c Mon Sep 17 00:00:00 2001 From: Brian Power Date: Thu, 28 Apr 2016 10:52:47 +0100 Subject: [PATCH] Improved Coverage Improving coverage and it is building locally. --- .gitignore | 38 +++++++++++++++++++++++++++++++++++--- .travis.yml | 24 ++++++++++++++++++++++++ package.json | 4 +++- test/index.test.js | 25 ++++++++++++++++++++++++- 4 files changed, 86 insertions(+), 5 deletions(-) create mode 100644 .travis.yml diff --git a/.gitignore b/.gitignore index 5be4f13..43725c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,37 @@ +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +npm-debug.log + node_modules *~ -.DS_STORE -npm-debug.log -test.js + +data + +test/mine.options.js +test/data + +.build + +old/* +bower_components/* + +*.ldb +*.log +CURRENT +LOCK +LOG +*.old +MANIFEST-* +testcov.html +srv/data* diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..11e0a3a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,24 @@ +sudo: false + +language: node_js + +node_js: + - 5 + - 4 + +cache: + directories: + - node_modules + +after_script: + - npm run cov + +env: + - CXX=g++-4.8 + +addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - g++-4.8 diff --git a/package.json b/package.json index b2e4772..64f9e7a 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "start": "node srv/start.js", "lint": "lab test -dL", "isolated": "TRAVIS_ISOLATED=true node srv/start.js", - "test": "lab -v -P test -L -c -t 76" + "test": "lab -v -P test -L -c -t 76", + "cov": "lab -s -P test -r lcov | coveralls" }, "homepage": "https://github.com/nodezoo/nodezoo-travis#readme", "dependencies": { @@ -39,6 +40,7 @@ "travis-ci": "2.1.0" }, "devDependencies": { + "coveralls": "2.11.9", "code": "2.2.0", "eslint-config-seneca": "1.1.x", "eslint-plugin-hapi": "4.0.x", diff --git a/test/index.test.js b/test/index.test.js index 13c8197..7b53026 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -17,7 +17,7 @@ function createInstance () { .use('entity') .use('../lib/travis') } -process.setMaxListeners(12) +process.setMaxListeners(999) var si = createInstance() @@ -131,4 +131,27 @@ describe('nodezoo-travis tests', () => { done(err) }) }) + it('test No Data', function (done) { + var si = createInstance() + si.act(_.extend({ role: 'travis', cmd: 'get' }), function (err, reply) { + expect(err).to.not.exist() + done(err) + }) + }) + it('test aliasGet Invalid', function (done) { + var si = createInstance() + var payload = { 'name': 'scoobydoobydoo' } + si.act(_.extend({ role: 'info', req: 'part' }, payload), function (err, reply) { + expect(err).to.exist() + done() + }) + }) + it('test aliasGet RealData', function (done) { + var si = createInstance() + var payload = { 'name': 'seneca', 'user': 'powerbrian', 'repo': 'https://github.com/senecajs/seneca' } + si.act(_.extend({ role: 'info', req: 'part' }, payload), function (err, reply) { + expect(err).to.not.exist() + done(err) + }) + }) })