forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: use
spawn
and spawnPromisified
instead of exec
PR-URL: nodejs#48991 Reviewed-By: Chemi Atlow <[email protected]> Reviewed-By: Debadree Chatterjee <[email protected]>
- Loading branch information
Showing
7 changed files
with
101 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
const assert = require('assert'); | ||
const childProcess = require('child_process'); | ||
const url = require('url'); | ||
|
||
// https://github.com/joyent/node/issues/568 | ||
|
@@ -82,13 +81,12 @@ if (common.hasIntl) { | |
'git+ssh://[email protected]:npm/npm', | ||
]; | ||
badURLs.forEach((badURL) => { | ||
childProcess.exec(`${process.execPath} -e "url.parse('${badURL}')"`, | ||
common.mustCall((err, stdout, stderr) => { | ||
assert.strictEqual(err, null); | ||
assert.strictEqual(stdout, ''); | ||
assert.match(stderr, /\[DEP0170\] DeprecationWarning:/); | ||
}) | ||
); | ||
common.spawnPromisified(process.execPath, ['-e', `url.parse(${JSON.stringify(badURL)})`]) | ||
.then(common.mustCall(({ code, stdout, stderr }) => { | ||
assert.strictEqual(code, 0); | ||
assert.strictEqual(stdout, ''); | ||
assert.match(stderr, /\[DEP0170\] DeprecationWarning:/); | ||
})); | ||
}); | ||
|
||
// Warning should only happen once per process. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.