Skip to content

Commit

Permalink
Merge 0734aaf into 6f3eda8
Browse files Browse the repository at this point in the history
  • Loading branch information
bcoe committed Jun 10, 2016
2 parents 6f3eda8 + 0734aaf commit 369c97e
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 18 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
[![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit)
[![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master)
[![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit)
[![Windows Tests](https://img.shields.io/appveyor/ci/tapjs/signal-exit/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/tapjs/signal-exit)
[![Windows Tests](https://img.shields.io/appveyor/ci/bcoe/signal-exit/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/bcoe/signal-exit)
[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version)

When you want to fire an event no matter how a process exits:

Expand Down
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"description": "when you want to fire an event no matter how a process exits.",
"main": "index.js",
"scripts": {
"posttest": "standard",
"pretest": "standard",
"test": "tap --timeout=240 ./test/*.js --cov",
"coverage": "nyc report --reporter=text-lcov | coveralls"
"coverage": "nyc report --reporter=text-lcov | coveralls",
"release": "standard-version"
},
"files": [
"index.js",
Expand All @@ -27,10 +28,11 @@
},
"homepage": "https://github.com/tapjs/signal-exit",
"devDependencies": {
"chai": "^2.3.0",
"chai": "^3.5.0",
"coveralls": "^2.11.2",
"nyc": "^5.1.0",
"standard": "^3.9.0",
"tap": "^4.0.0"
"nyc": "^6.4.4",
"standard": "^7.1.2",
"standard-version": "^2.3.0",
"tap": "^5.7.2"
}
}
6 changes: 4 additions & 2 deletions signals.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ if (process.platform !== 'win32') {
'SIGTRAP',
'SIGSYS',
'SIGQUIT',
'SIGIOT',
'SIGPROF'
'SIGIOT'
// should detect profiler and enable/disable accordingly.
// see #21
// 'SIGPROF'
)
}

Expand Down
1 change: 0 additions & 1 deletion test/all-integration-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ require('tap').mochaGlobals()
var onSignalExit = require('../')

describe('all-signals-integration-test', function () {

// These are signals that are aliases for other signals, so
// the result will sometimes be one of the others. For these,
// we just verify that we GOT a signal, not what it is.
Expand Down
6 changes: 4 additions & 2 deletions test/fixtures/change-code.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
var join = require('path').join

if (process.argv.length === 2) {
var types = [ 'explicit', 'code', 'normal' ]
var codes = [ 0, 2, 'null' ]
var changes = [ 'nochange', 'change', 'code', 'twice', 'twicecode']
var changes = [ 'nochange', 'change', 'code', 'twice', 'twicecode' ]
var handlers = [ 'sigexit', 'nosigexit' ]
var opts = []
types.forEach(function (type) {
Expand Down Expand Up @@ -77,7 +79,7 @@ function listener (code, signal) {
function run (opt) {
console.error(opt)
var shell = process.platform === 'win32' ? null : { shell: '/bin/bash' }
exec(process.execPath + ' ' + __filename + ' ' + opt, shell, function (err, stdout, stderr) {
exec(join(process.execPath, ' ', __filename, ' ' + opt), shell, function (err, stdout, stderr) {
var res = JSON.parse(stdout)
if (err) {
res.actualCode = err.code
Expand Down
1 change: 0 additions & 1 deletion test/fixtures/exiter.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ if (isNaN(exit)) {
} catch (er) {
wanted = [ 0, null ]
}

} else {
exit = +exit
wanted = [ exit, null ]
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/multiple-load.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ onSignalExit(function (code, signal) {
})

delete require('module')._cache[require.resolve('../../')]
var onSignalExit = require('../../')
onSignalExit = require('../../')

onSignalExit(function (code, signal) {
counter++
Expand All @@ -31,7 +31,7 @@ onSignalExit(function (code, signal) {

// Lastly, some that should NOT be shown
delete require('module')._cache[require.resolve('../../')]
var onSignalExit = require('../../')
onSignalExit = require('../../')

var unwrap = onSignalExit(function (code, signal) {
counter++
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/signal-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (process.argv[2]) {
'SIGLOST',
'SIGPIPE',
'SIGPOLL',
'SIGPROF',
// 'SIGPROF', see #21
'SIGPWR',
'SIGQUIT',
'SIGSEGV',
Expand Down
2 changes: 1 addition & 1 deletion test/multi-exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var codes = [ 0, 2, 'null' ]

// do not change, change to 5 with exit(), change to 5 with exitCode,
// change to 5 and then to 2 with exit(), change twice with exitcode
var changes = [ 'nochange', 'change', 'twice']
var changes = [ 'nochange', 'change', 'twice' ]
if (!isZero10()) changes.push('code', 'twicecode')

// use signal-exit, use process.on('exit')
Expand Down
1 change: 0 additions & 1 deletion test/signal-exit-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ require('chai').should()
require('tap').mochaGlobals()

describe('signal-exit', function () {

it('receives an exit event when a process exits normally', function (done) {
exec(node + ' ./test/fixtures/end-of-execution.js', shell, function (err, stdout, stderr) {
expect(err).to.equal(null)
Expand Down

0 comments on commit 369c97e

Please sign in to comment.