| 46 | let server; |
| 47 | |
| 48 | function executeRequest(cb) { |
| 49 | // The execPath might contain chars that should be escaped in a shell context. |
| 50 | // On non-Windows, we can pass the path via the env; `"` is not a valid char on |
| 51 | // Windows, so we can simply pass the path. |
| 52 | const node = `"${common.isWindows ? process.execPath : '$NODE'}"`; |
| 53 | const file = `"${common.isWindows ? __filename : '$FILE'}"`; |
| 54 | const env = common.isWindows ? process.env : { ...process.env, NODE: process.execPath, FILE: __filename }; |
| 55 | cp.exec([node, |
| 56 | file, |
| 57 | 'request', |
| 58 | server.address().port, |
| 59 | '|', |
| 60 | node, |
| 61 | file, |
| 62 | 'shasum' ].join(' '), |
| 63 | { env }, |
| 64 | common.mustCall((err, stdout, stderr) => { |
| 65 | if (stderr.trim() !== '') { |
| 66 | console.log(stderr); |
| 67 | } |
| 68 | assert.ifError(err); |
| 69 | assert.strictEqual(stdout.slice(0, 40), |
| 70 | '8c206a1a87599f532ce68675536f0b1546900d7a'); |
| 71 | cb(); |
| 72 | }) |
| 73 | ); |
| 74 | } |
| 75 | |
| 76 | |
| 77 | tmpdir.refresh(); |