Skip to content

Commit 824e08a

Browse files
pjohnmeyerisaacs
authored andcommitted
Apply 'standard' to test/cli.js
1 parent 8bcd207 commit 824e08a

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

test/cli.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
'use strict'
2-
var t = require('tap');
2+
var t = require('tap')
33

44
const spawn = require('child_process').spawn
55
const bin = require.resolve('../bin/semver')
6-
const run = args => new Promise((res, rej) => {
6+
const run = args => new Promise((resolve, reject) => {
77
const c = spawn(process.execPath, [bin].concat(args))
8-
c.on('error', rej)
8+
c.on('error', reject)
99
const out = []
1010
const err = []
1111
c.stdout.setEncoding('utf-8')
1212
c.stdout.on('data', chunk => out.push(chunk))
1313
c.stderr.setEncoding('utf-8')
1414
c.stderr.on('data', chunk => err.push(chunk))
1515
c.on('close', (code, signal) => {
16-
res({
16+
resolve({
1717
out: out.join(''),
1818
err: err.join(''),
1919
code: code,
@@ -22,13 +22,10 @@ const run = args => new Promise((res, rej) => {
2222
})
2323
})
2424

25-
const runTest = (t, args, expect) =>
26-
run(args).then(actual => t.match(actual, expect))
27-
2825
t.test('inc tests', t => {
2926
[
3027
[['-i', 'major', '1.0.0'], { out: '2.0.0', code: 0, signal: null }],
3128
[['-i', 'major', '1.0.0', '1.0.1'], { out: '', err: '--inc can only be used on a single version with no range', code: 1 }]
3229
].forEach(c => t.resolveMatch(run(c[0]), c[1]))
3330
t.end()
34-
});
31+
})

0 commit comments

Comments
 (0)