| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6a7d24b commit 561d504
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,8 +55,13 @@ function onsigusr2() { | |||
| 55 | 55 | process.on('SIGUSR2', common.mustCall(onsigusr2Again)); | |
| 56 | 56 | ||
| 57 | 57 | const as = hooks.activitiesOfTypes('SIGNALWRAP'); | |
| 58 | - assert.strictEqual(as.length, 2); | ||
| 59 | - signal2 = as[1]; | ||
| 58 | + // The isTTY checks are needed to allow test to work whether run with | ||
| 59 | + // test.py or directly with the node executable. The third signal event | ||
| 60 | + // listener is the SIGWINCH handler that node installs when it thinks | ||
| 61 | + // process.stdout is a tty. | ||
| 62 | + const expectedLen = 2 + (!!process.stdout.isTTY || !!process.stderr.isTTY); | ||
| 63 | + assert.strictEqual(as.length, expectedLen); | ||
| 64 | + signal2 = as[expectedLen - 1]; // Last item in the array. | ||
| 60 | 65 | assert.strictEqual(signal2.type, 'SIGNALWRAP'); | |
| 61 | 66 | assert.strictEqual(typeof signal2.uid, 'number'); | |
| 62 | 67 | assert.strictEqual(typeof signal2.triggerAsyncId, 'number'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments