|
@ -53,7 +53,8 @@ try { |
|
|
assert.strictEqual(e.errno, 'ETIMEDOUT'); |
|
|
assert.strictEqual(e.errno, 'ETIMEDOUT'); |
|
|
err = e; |
|
|
err = e; |
|
|
} finally { |
|
|
} finally { |
|
|
assert.strictEqual(ret, undefined, 'we should not have a return value'); |
|
|
assert.strictEqual(ret, undefined, |
|
|
|
|
|
`should not have a return value, received ${ret}`); |
|
|
assert.strictEqual(caught, true, 'execSync should throw'); |
|
|
assert.strictEqual(caught, true, 'execSync should throw'); |
|
|
const end = Date.now() - start; |
|
|
const end = Date.now() - start; |
|
|
assert(end < SLEEP); |
|
|
assert(end < SLEEP); |
|
@ -74,11 +75,11 @@ cmd = `"${process.execPath}" -e "console.log('${msg}');"`; |
|
|
ret = execSync(cmd); |
|
|
ret = execSync(cmd); |
|
|
|
|
|
|
|
|
assert.strictEqual(ret.length, msgBuf.length); |
|
|
assert.strictEqual(ret.length, msgBuf.length); |
|
|
assert.deepStrictEqual(ret, msgBuf, 'execSync result buffer should match'); |
|
|
assert.deepStrictEqual(ret, msgBuf); |
|
|
|
|
|
|
|
|
ret = execSync(cmd, { encoding: 'utf8' }); |
|
|
ret = execSync(cmd, { encoding: 'utf8' }); |
|
|
|
|
|
|
|
|
assert.strictEqual(ret, `${msg}\n`, 'execSync encoding result should match'); |
|
|
assert.strictEqual(ret, `${msg}\n`); |
|
|
|
|
|
|
|
|
const args = [ |
|
|
const args = [ |
|
|
'-e', |
|
|
'-e', |
|
@ -90,8 +91,7 @@ assert.deepStrictEqual(ret, msgBuf); |
|
|
|
|
|
|
|
|
ret = execFileSync(process.execPath, args, { encoding: 'utf8' }); |
|
|
ret = execFileSync(process.execPath, args, { encoding: 'utf8' }); |
|
|
|
|
|
|
|
|
assert.strictEqual(ret, `${msg}\n`, |
|
|
assert.strictEqual(ret, `${msg}\n`); |
|
|
'execFileSync encoding result should match'); |
|
|
|
|
|
|
|
|
|
|
|
// Verify that the cwd option works - GH #7824
|
|
|
// Verify that the cwd option works - GH #7824
|
|
|
{ |
|
|
{ |
|
|