| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent b7cbb80 commit 1adfca4
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,18 +17,10 @@ const child = spawn(process.execPath, [ '-i' ], { | |||
| 17 | 17 | ||
| 18 | 18 | let stdout = ''; | |
| 19 | 19 | child.stdout.setEncoding('utf8'); | |
| 20 | - child.stdout.pipe(process.stdout); | ||
| 21 | 20 | child.stdout.on('data', function(c) { | |
| 22 | 21 | stdout += c; | |
| 23 | 22 | }); | |
| 24 | 23 | ||
| 25 | - child.stdin.write = ((original) => { | ||
| 26 | - return (chunk) => { | ||
| 27 | - process.stderr.write(chunk); | ||
| 28 | - return original.call(child.stdin, chunk); | ||
| 29 | - }; | ||
| 30 | - })(child.stdin.write); | ||
| 31 | - | ||
| 32 | 24 | child.stdout.once('data', common.mustCall(() => { | |
| 33 | 25 | process.on('SIGUSR2', common.mustCall(() => { | |
| 34 | 26 | process.kill(child.pid, 'SIGINT'); | |
@@ -45,6 +37,12 @@ child.stdout.once('data', common.mustCall(() => { | |||
| 45 | 37 | ||
| 46 | 38 | child.on('close', function(code) { | |
| 47 | 39 | assert.strictEqual(code, 0); | |
| 48 | - assert.notStrictEqual(stdout.indexOf('Script execution interrupted.\n'), -1); | ||
| 49 | - assert.notStrictEqual(stdout.indexOf('42042\n'), -1); | ||
| 40 | + assert.ok( | ||
| 41 | + stdout.includes('Script execution interrupted.\n'), | ||
| 42 | + `Expected stdout to contain "Script execution interrupted.", got ${stdout}` | ||
| 43 | + ); | ||
| 44 | + assert.ok( | ||
| 45 | + stdout.includes('42042\n'), | ||
| 46 | + `Expected stdout to contain "42042", got ${stdout}` | ||
| 47 | + ); | ||
| 50 | 48 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments