Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved Coverage #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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*
24 changes: 24 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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",
Expand Down
25 changes: 24 additions & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function createInstance () {
.use('entity')
.use('../lib/travis')
}
process.setMaxListeners(12)
process.setMaxListeners(999)

var si = createInstance()

Expand Down Expand Up @@ -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)
})
})
})