Skip to content

Commit

Permalink
parser: remove node v12 skip check
Browse files Browse the repository at this point in the history
v12 hasn't been supported for a long time, and this check
is a false-positive on node v20
  • Loading branch information
isaacs committed Sep 10, 2023
1 parent 3f8e831 commit 1280a55
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/parser/test/cmd.ts
Expand Up @@ -11,14 +11,6 @@ const require = createRequire(import.meta.url)
const bin = require.resolve('../bin/cmd.cjs')
const node = process.execPath

// util.inspect output changed in node v12
// so don't test it unless we're at that version.
const skipInspect = {
skip: /^v1[2-9]\./.test(process.version)
? false
: 'do not test util.inspect prior to node v12',
}

const code = readFileSync(bin, 'utf8').replace(/^#!.*/, '')
class MockProc extends EE {
public exitCode: number = 0
Expand Down Expand Up @@ -162,7 +154,7 @@ ok 1 - child
const runTest = (tap: string) => (t: Test, args: string[]) => {
run(tap, args, (er, o, e) => {
t.matchSnapshot(er, 'error')
t.matchSnapshot(o, 'output', skipInspect)
t.matchSnapshot(o, 'output')
t.matchSnapshot(e, 'stderr')
t.end()
})
Expand Down Expand Up @@ -217,7 +209,7 @@ ok 1 - child
t.test('unrecognized arg', t =>
run('', ['--blarg'], (er, o, e) => {
t.matchSnapshot(er, 'error')
t.matchSnapshot(o, 'output', skipInspect)
t.matchSnapshot(o, 'output')
t.matchSnapshot(e, 'stderr')
t.end()
})
Expand Down

0 comments on commit 1280a55

Please sign in to comment.