Skip to content

Commit 5ae5937

Browse files
committed
fix: combining --esbuild with incompatible engine flags should error
1 parent 6268a18 commit 5ae5937

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

bin/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ function parseOptions() {
5959
dropNetwork: getEnvFlag('EXODUS_TEST_DROP_NETWORK'),
6060
ideaCompat: false,
6161
engine: process.env.EXODUS_TEST_ENGINE ?? 'node:test',
62+
flagEngine: false, // Option combination error reporting differs when engine is passed by flag or env
6263
entropySize: 5 * 1024,
6364
require: [],
6465
testNamePattern: [],
@@ -143,6 +144,7 @@ function parseOptions() {
143144
break
144145
case '--engine':
145146
options.engine = args.shift()
147+
options.flagEngine = true
146148
break
147149
case '--debug-files':
148150
options.debug.files = true
@@ -317,7 +319,8 @@ if (options.esbuild && !options.bundle) {
317319
assert(resolveImport)
318320
if (options.hasImportLoader) {
319321
args.push('--import', resolveImport('../loaders/esbuild.js'))
320-
} else if (options.engine === process.env.EXODUS_TEST_ENGINE) {
322+
} else if (options.flagEngine === false) {
323+
// Engine is set via env, --esbuild set via flag. Allow but warn
321324
console.warn(`Warning: ${engineName} does not support --esbuild option`)
322325
} else {
323326
console.error(`Error: ${engineName} does not support --esbuild option`)

0 commit comments

Comments
 (0)