| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 12e54e3 commit 01bed64
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -318,7 +318,7 @@ class FileTest extends Test { | |||
| 318 | 318 | ||
| 319 | 319 | function runTestFile(path, filesWatcher, opts) { | |
| 320 | 320 | const watchMode = filesWatcher != null; | |
| 321 | - const subtest = opts.root.createSubtest(FileTest, path, async (t) => { | ||
| 321 | + const subtest = opts.root.createSubtest(FileTest, path, { __proto__: null, signal: opts.signal }, async (t) => { | ||
| 322 | 322 | const args = getRunArgs(path, opts); | |
| 323 | 323 | const stdio = ['pipe', 'pipe', 'pipe']; | |
| 324 | 324 | const env = { __proto__: null, ...process.env, NODE_TEST_CONTEXT: 'child-v8' }; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -176,6 +176,17 @@ describe('require(\'node:test\').run', { concurrency: true }, () => { | |||
| 176 | 176 | }); | |
| 177 | 177 | ||
| 178 | 178 | describe('AbortSignal', () => { | |
| 179 | + it('should accept a signal', async () => { | ||
| 180 | + const stream = run({ signal: AbortSignal.timeout(50), files: [ | ||
| 181 | + fixtures.path('test-runner', 'never_ending_sync.js'), | ||
| 182 | + fixtures.path('test-runner', 'never_ending_async.js'), | ||
| 183 | + ] }); | ||
| 184 | + stream.on('test:fail', common.mustCall(2)); | ||
| 185 | + stream.on('test:pass', common.mustNotCall()); | ||
| 186 | + // eslint-disable-next-line no-unused-vars | ||
| 187 | + for await (const _ of stream); | ||
| 188 | + }); | ||
| 189 | + | ||
| 179 | 190 | it('should stop watch mode when abortSignal aborts', async () => { | |
| 180 | 191 | const controller = new AbortController(); | |
| 181 | 192 | const result = await run({ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments