Skip to content

Commit

Permalink
Remove some tests of things that can't be done in v11+
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jan 21, 2019
1 parent f61181a commit 3620c76
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 10 additions & 1 deletion lib/tap.js
Expand Up @@ -7,6 +7,9 @@ const objToYaml = require('./obj-to-yaml.js')
const yaml = require('js-yaml')
const _didPipe = Symbol('_didPipe')

// We test that file separately, and removing stdout
// causes some weird behavior in the Node test runner.
/* istanbul ignore next */
if (!process.stdout) {
require('./stdio-polyfill')()
}
Expand All @@ -25,6 +28,7 @@ const monkeypatchExit = () => {

// ensure that we always get run, even if a user does
// process.on('exit', process.exit)
/* istanbul ignore next */
process.reallyExit = code =>
reallyExit.call(process, onExitEvent(code))

Expand Down Expand Up @@ -100,7 +104,7 @@ class TAP extends Test {
let didOnExitEvent = false
const onExitEvent = code => {
if (didOnExitEvent)
return process.exitCode || code
return process.exitCode

didOnExitEvent = true

Expand All @@ -109,6 +113,8 @@ const onExitEvent = code => {

if (tap.results && !tap.results.ok && code === 0) {
process.exitCode = 1
// We don't test with these any more. They don't work much anyway.
/* istanbul ignore next */
if (process.version.match(/^v0\.(10|[0-9])\./))
process.exit(code)
}
Expand Down Expand Up @@ -181,6 +187,9 @@ onExit((code, signal) => {
return ret
})
}

// Newer node versions don't have this as reliably.
/* istanbul ignore next */
if (handles.length) {
extra.handles = handles.map(h => {
const ret = {}
Expand Down
4 changes: 0 additions & 4 deletions test/tap.js
Expand Up @@ -38,10 +38,6 @@ const cases = {
t.on('teardown', () => { throw new Error('poop') })
t.pass('x')
},
'process.exitCode polyfill': t => {
Object.defineProperty(process, 'version', { value: 'v0.10.420' })
t.fail(process.version)
},
'TAP_DEBUG=1': [
() => process.env.TAP_DEBUG = '1',
t => t.comment('this is fine')
Expand Down

0 comments on commit 3620c76

Please sign in to comment.