Skip to content

Commit b763a31

Browse files
Trottaddaleax
authored andcommitted
test: refactor test-child-process-exec-error
* assert.equal() -> assert.strictEqual() * regex -> .include() * Change variable representing a function from `fun` to idiomatic `fn` * var -> const PR-URL: #9780 Reviewed-By: Santiago Gimeno <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Evan Lucas <[email protected]> Reviewed-By: Prince John Wesley <[email protected]>
1 parent 9554a97 commit b763a31

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/parallel/test-child-process-exec-error.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
'use strict';
2-
var common = require('../common');
3-
var assert = require('assert');
4-
var child_process = require('child_process');
2+
const common = require('../common');
3+
const assert = require('assert');
4+
const child_process = require('child_process');
55

6-
function test(fun, code) {
7-
fun('does-not-exist', common.mustCall(function(err) {
8-
assert.equal(err.code, code);
9-
assert(/does\-not\-exist/.test(err.cmd));
6+
function test(fn, code) {
7+
fn('does-not-exist', common.mustCall(function(err) {
8+
assert.strictEqual(err.code, code);
9+
assert(err.cmd.includes('does-not-exist'));
1010
}));
1111
}
1212

0 commit comments

Comments
 (0)