From dc0cf5ba30e581fd808c245baf819f3a2779c2ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9e=20Kooi?= Date: Fri, 10 Aug 2018 12:50:05 +0200 Subject: [PATCH] Fix spawning child proc in test on windows --- test/onPort.test.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/test/onPort.test.js b/test/onPort.test.js index 31f3b949..488d95be 100644 --- a/test/onPort.test.js +++ b/test/onPort.test.js @@ -1,10 +1,10 @@ 'use strict' +const path = require('path') const { test } = require('tap') const spawn = require('child_process').spawn const split = require('split2') const hasAsyncHooks = require('has-async-hooks') -const autocannon = require.resolve('../autocannon') const target = require.resolve('./targetProcess') test('--on-port flag', { skip: !hasAsyncHooks() }, (t) => { @@ -23,7 +23,8 @@ test('--on-port flag', { skip: !hasAsyncHooks() }, (t) => { t.plan(lines.length * 2) - const child = spawn(autocannon, [ + const child = spawn(process.execPath, [ + path.join(__dirname, '..'), '-c', '10', '-d', '1', '--on-port', '/',