Skip to content

Commit

Permalink
added tap coverage, updated travis
Browse files Browse the repository at this point in the history
  • Loading branch information
rvagg committed Jun 15, 2016
1 parent aebd2e9 commit 7f26458
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Files
.lock-wscript
.nyc_output

# Filetypes
.*.swp

# Paths
/build

node_modules
/node_modules
/coverage
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
language: node_js

node_js:
- "0.12"
- "0.10"
- "0.12"
- "4"
- "stable"
- "6"

env:
global:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"license": "MIT",
"scripts": {
"install": "node-gyp configure build",
"test": "standard && tap test/*.js"
"test": "standard && tap --cov test/*.js"
},
"contributors": [
"James Halliday <[email protected]>"
Expand Down
9 changes: 3 additions & 6 deletions test/seed.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
var exec = require('child_process').exec
var path = require('path')
var test = require('tap').test

test('rand', function (t) {
var to = setTimeout(function () {
t.fail('never executed')
}, 5000)

var cmd = 'node -e \'console.log(require(' +
JSON.stringify(path.join(__dirname, '..')) +
').rand(1000).toString())\''
var cmd = 'node -e \'console.log(require("../").rand(1000).toString())\''

exec(cmd, function (err1, r1) {
exec(cmd, function (err2, r2) {
exec(cmd, { cwd: __dirname }, function (err1, r1) {
exec(cmd, { cwd: __dirname }, function (err2, r2) {
clearTimeout(to)

t.ok(!err1)
Expand Down

0 comments on commit 7f26458

Please sign in to comment.