|
| 1 | +'use strict'; |
| 2 | +require('../common'); |
| 3 | +const fixtures = require('../common/fixtures'); |
| 4 | +const assert = require('assert'); |
| 5 | +const { spawnSync } = require('child_process'); |
| 6 | + |
| 7 | +{ |
| 8 | + const child = spawnSync(process.execPath, [ |
| 9 | + '--test', |
| 10 | + fixtures.path('test-runner', 'extraneous_set_immediate_async.mjs'), |
| 11 | + ]); |
| 12 | + const stdout = child.stdout.toString(); |
| 13 | + assert.match(stdout, /^# pass 0$/m); |
| 14 | + assert.match(stdout, /^# fail 1$/m); |
| 15 | + assert.match(stdout, /^# cancelled 0$/m); |
| 16 | + assert.strictEqual(child.status, 1); |
| 17 | + assert.strictEqual(child.signal, null); |
| 18 | +} |
| 19 | + |
| 20 | +{ |
| 21 | + const child = spawnSync(process.execPath, [ |
| 22 | + '--test', |
| 23 | + fixtures.path('test-runner', 'extraneous_set_timeout_async.mjs'), |
| 24 | + ]); |
| 25 | + const stdout = child.stdout.toString(); |
| 26 | + assert.match(stdout, /^# pass 0$/m); |
| 27 | + assert.match(stdout, /^# fail 1$/m); |
| 28 | + assert.match(stdout, /^# cancelled 0$/m); |
| 29 | + assert.strictEqual(child.status, 1); |
| 30 | + assert.strictEqual(child.signal, null); |
| 31 | +} |
0 commit comments