bunosh 0.4.10 → 0.4.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bunosh.js +4 -21
- package/package.json +1 -1
- package/src/io.js +1 -1
package/bunosh.js
CHANGED
|
@@ -326,8 +326,11 @@ process.on('exit', (code) => {
|
|
|
326
326
|
const tasksWarning = tasksExecuted.filter(ti => ti.result?.status === TaskStatus.WARNING).length;
|
|
327
327
|
|
|
328
328
|
const commandArgs = process.argv.slice(2);
|
|
329
|
+
|
|
330
|
+
// Test environment detection
|
|
329
331
|
const isTestEnvironment = process.env.NODE_ENV === 'test' ||
|
|
330
|
-
(typeof
|
|
332
|
+
(typeof jest !== 'undefined' && jest.isRunning) ||
|
|
333
|
+
(process.env.VITEST_WORKER_ID !== undefined) ||
|
|
331
334
|
commandArgs.some(arg => {
|
|
332
335
|
const lowerArg = arg.toLowerCase();
|
|
333
336
|
return lowerArg.includes('vitest') ||
|
|
@@ -338,26 +341,6 @@ process.on('exit', (code) => {
|
|
|
338
341
|
|
|
339
342
|
const ignoreFailuresMode = globalThis._bunoshIgnoreFailuresMode || false;
|
|
340
343
|
|
|
341
|
-
if (process.env.BUNOSH_DEBUG) {
|
|
342
|
-
console.log('\n[DEBUG] Exit handler:');
|
|
343
|
-
console.log(' tasksFailed:', tasksFailed);
|
|
344
|
-
console.log(' isTestEnvironment:', isTestEnvironment);
|
|
345
|
-
console.log(' ignoreFailuresMode:', ignoreFailuresMode);
|
|
346
|
-
console.log(' NODE_ENV:', process.env.NODE_ENV);
|
|
347
|
-
console.log(' commandArgs:', commandArgs);
|
|
348
|
-
console.log(' full process.argv:', process.argv);
|
|
349
|
-
if (isTestEnvironment) {
|
|
350
|
-
const matchingArg = commandArgs.find(arg => {
|
|
351
|
-
const lowerArg = arg.toLowerCase();
|
|
352
|
-
return lowerArg.includes('vitest') ||
|
|
353
|
-
lowerArg.includes('jest') ||
|
|
354
|
-
lowerArg === '--test' ||
|
|
355
|
-
lowerArg.startsWith('test:');
|
|
356
|
-
});
|
|
357
|
-
console.log(' Matched command arg:', matchingArg);
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
|
|
361
344
|
if (tasksFailed > 0 && !isTestEnvironment && !ignoreFailuresMode) {
|
|
362
345
|
process.exitCode = 1;
|
|
363
346
|
}
|
package/package.json
CHANGED