| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 190ddce commit d5d56ec
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,11 +53,24 @@ const execOpts = { encoding: 'utf8', shell: true }; | |||
| 53 | 53 | const ac = new AbortController(); | |
| 54 | 54 | const { signal } = ac; | |
| 55 | 55 | ||
| 56 | - const callback = common.mustCall((err) => { | ||
| 56 | + const firstCheck = common.mustCall((err) => { | ||
| 57 | 57 | assert.strictEqual(err.code, 'ABORT_ERR'); | |
| 58 | 58 | assert.strictEqual(err.name, 'AbortError'); | |
| 59 | + assert.strictEqual(err.signal, undefined); | ||
| 60 | + }); | ||
| 61 | + | ||
| 62 | + const secondCheck = common.mustCall((err) => { | ||
| 63 | + assert.strictEqual(err.code, null); | ||
| 64 | + assert.strictEqual(err.name, 'Error'); | ||
| 65 | + assert.strictEqual(err.signal, 'SIGTERM'); | ||
| 59 | 66 | }); | |
| 60 | - execFile(process.execPath, [echoFixture, 0], { signal }, callback); | ||
| 67 | + | ||
| 68 | + execFile(process.execPath, [echoFixture, 0], { signal }, (err) => { | ||
| 69 | + firstCheck(err); | ||
| 70 | + // Test that re-using the aborted signal results in immediate SIGTERM. | ||
| 71 | + execFile(process.execPath, [echoFixture, 0], { signal }, secondCheck); | ||
| 72 | + }); | ||
| 73 | + | ||
| 61 | 74 | ac.abort(); | |
| 62 | 75 | } | |
| 63 | 76 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments