Improve test to preserve internal spacing and to inspect error
This commit is contained in:
parent
711dea9623
commit
799fd96680
1 changed files with 3 additions and 2 deletions
5
test.js
5
test.js
|
@ -28,7 +28,8 @@ kill(
|
|||
var command = 'echo %SUDO_PROMPT_TEST_ENV%';
|
||||
var expected = 'hello world\r\n';
|
||||
} else {
|
||||
var command = 'echo $SUDO_PROMPT_TEST_ENV';
|
||||
// We use double quotes to tell echo to preserve internal space:
|
||||
var command = 'echo "$SUDO_PROMPT_TEST_ENV"';
|
||||
var expected = 'hello world\n';
|
||||
}
|
||||
console.log(
|
||||
|
@ -39,7 +40,7 @@ kill(
|
|||
);
|
||||
sudo.exec(command, options,
|
||||
function(error, stdout, stderr) {
|
||||
console.log('error: ' + error);
|
||||
console.log('error:', error);
|
||||
console.log('stdout: ' + JSON.stringify(stdout));
|
||||
console.log('stderr: ' + JSON.stringify(stderr));
|
||||
kill(
|
||||
|
|
Loading…
Reference in a new issue