summaryrefslogtreecommitdiff
path: root/packages/core/src/services/shellExecutionService.test.ts
diff options
context:
space:
mode:
authorRichie Foreman <[email protected]>2025-08-06 19:31:42 -0400
committerGitHub <[email protected]>2025-08-06 23:31:42 +0000
commit4782113cebc990b54353e095db1eb6c5e654bdef (patch)
treed087dfa743d8d0dd7f00e2dee5c766411d720e90 /packages/core/src/services/shellExecutionService.test.ts
parent626844b539af6bf6d21a04d43173074c98b71474 (diff)
fix(core): Improve errors in situations where the command spawn does … (#5723)
Diffstat (limited to 'packages/core/src/services/shellExecutionService.test.ts')
-rw-r--r--packages/core/src/services/shellExecutionService.test.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/core/src/services/shellExecutionService.test.ts b/packages/core/src/services/shellExecutionService.test.ts
index cfce08d2..2fe51a5e 100644
--- a/packages/core/src/services/shellExecutionService.test.ts
+++ b/packages/core/src/services/shellExecutionService.test.ts
@@ -185,6 +185,16 @@ describe('ShellExecutionService', () => {
expect(result.error).toBe(spawnError);
expect(result.exitCode).toBe(1);
});
+
+ it('handles errors that do not fire the exit event', async () => {
+ const error = new Error('spawn abc ENOENT');
+ const { result } = await simulateExecution('touch cat.jpg', (cp) => {
+ cp.emit('error', error); // No exit event is fired.
+ });
+
+ expect(result.error).toBe(error);
+ expect(result.exitCode).toBe(1);
+ });
});
describe('Aborting Commands', () => {