diff --git a/bundler/bundle.js b/bundler/bundle.js index 872cd24..f4c84bb 100644 --- a/bundler/bundle.js +++ b/bundler/bundle.js @@ -261,7 +261,6 @@ export const build = async (...files) => { 'process.type': 'undefined', 'process.version': stringify('v22.5.1'), // shouldn't depend on currently used Node.js version 'process.versions.node': stringify('22.5.1'), // see line above - 'process.cwd': 'EXODUS_TEST_PROCESS.cwd', EXODUS_TEST_PROCESS_CWD: stringify(process.cwd()), EXODUS_TEST_FILES: stringify(files.map((f) => [dirname(f), basename(f)])), EXODUS_TEST_SNAPSHOTS: stringify(EXODUS_TEST_SNAPSHOTS), @@ -327,6 +326,11 @@ export const build = async (...files) => { config.define['process.argv'] = stringify(['exodus-test', resolve(files[0])]) } + if (!['node', 'bun'].includes(options.platform)) { + config.define['process.cwd'] = 'EXODUS_TEST_PROCESS.cwd' + config.define['process.exit'] = 'EXODUS_TEST_PROCESS.exit' + } + let res = await buildWrap(config) assert.equal(res instanceof Error, res.errors.length > 0)