Skip to content

Commit 11e96fc

Browse files
committed
fix window tests with clearRequireCache
1 parent 823c647 commit 11e96fc

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

test/fixtures/run-destroy-from-parent/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const main = async () => {
1111
pipeIn.write(`${Bare.pid}\n`)
1212

1313
const pipe = Pear.run(entry)
14+
pipe.on('end', () => pipe.end())
1415

1516
const pid = await new Promise((resolve) => {
1617
pipe.on('data', (data) => resolve(data.toString()))

test/fixtures/run-end-from-parent/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const main = async () => {
1111
pipeIn.write(`${Bare.pid}\n`)
1212

1313
const pipe = Pear.run(entry)
14+
pipe.on('end', () => pipe.end())
1415

1516
const pid = await new Promise((resolve) => {
1617
pipe.on('data', (data) => resolve(data.toString()))

test/index.test.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -339,11 +339,11 @@ test('Pear.run exit when child calls pipe.destroy()', async function (t) {
339339
await Helper.untilExit(pid)
340340
})
341341

342-
test('Pear.run exit when parent calls pipe.end()', {skip: isWindows }, async function (t) {
342+
test('Pear.run exit when parent calls pipe.end()', async function (t) {
343343
const runEndFromParent = path.join(dirname, 'fixtures', 'run-end-from-parent')
344344
const runChild = path.join(dirname, 'fixtures', 'run-child')
345345

346-
const teardown = Helper.rig({ runtimeArgv: [runEndFromParent] })
346+
const teardown = Helper.rig({ runtimeArgv: [runEndFromParent], clearRequireCache: '../worker' })
347347
t.teardown(teardown)
348348

349349
const pipe = Pear.run(runEndFromParent, [runChild])
@@ -353,11 +353,11 @@ test('Pear.run exit when parent calls pipe.end()', {skip: isWindows }, async fun
353353
await Helper.untilExit(pid)
354354
})
355355

356-
test('Pear.run exit when parent calls pipe.destroy()', {skip: isWindows }, async function (t) {
356+
test('Pear.run exit when parent calls pipe.destroy()', async function (t) {
357357
const runDestroyFromParent = path.join(dirname, 'fixtures', 'run-destroy-from-parent')
358358
const runChildErrorHandler = path.join(dirname, 'fixtures', 'run-child-error-handler')
359359

360-
const teardown = Helper.rig({ runtimeArgv: [runDestroyFromParent] })
360+
const teardown = Helper.rig({ runtimeArgv: [runDestroyFromParent], clearRequireCache: '../worker' })
361361
t.teardown(teardown)
362362

363363
const pipe = Pear.run(runDestroyFromParent, [runChildErrorHandler])

0 commit comments

Comments
 (0)