diff --git a/scripts/control-pane.js b/scripts/control-pane.js index e5234d9c2..dceed7539 100755 --- a/scripts/control-pane.js +++ b/scripts/control-pane.js @@ -1,8 +1,6 @@ #!/usr/bin/env node 'use strict'; -const { spawn } = require('child_process'); - const { createControlPaneServer, parseArgs, diff --git a/scripts/plan-canvas.js b/scripts/plan-canvas.js index 6ecefe49a..4ed1b6331 100755 --- a/scripts/plan-canvas.js +++ b/scripts/plan-canvas.js @@ -20,6 +20,7 @@ const fs = require('fs'); const http = require('http'); const path = require('path'); +const { spawn } = require('child_process'); const { canonicalizeArtifactPath, createSessionStore, diff --git a/tests/scripts/control-pane.test.js b/tests/scripts/control-pane.test.js index 5503bcf95..7c9f4c102 100644 --- a/tests/scripts/control-pane.test.js +++ b/tests/scripts/control-pane.test.js @@ -602,11 +602,11 @@ async function runTests() { else failed++; if ( - await test('CLI browser opener handles spawn errors', async () => { + await test('CLI browser opener delegates spawn errors to the shared launcher', async () => { const source = fs.readFileSync(SCRIPT, 'utf8'); - assert.match(source, /child\.on\('error'/); - assert.match(source, /child\.unref\(\)/); + assert.match(source, /openBrowser: launchOpenBrowser/); + assert.match(source, /launchOpenBrowser\(url\)/); }) ) passed++;