diff --git a/src/objects/execution.ts b/src/objects/execution.ts index 0649842a5..457e0c995 100644 --- a/src/objects/execution.ts +++ b/src/objects/execution.ts @@ -30,21 +30,20 @@ export class Execution { } } - // Doesn't work as expected, the execution is killed when the stdin is sent. - // /** - // * Send input to the execution's stdin. - // * - // * @param input - The input to send - // * @param options - Request options - // */ - // async sendStdIn(input: string, options?: Core.RequestOptions): Promise { - // await this.client.devboxes.executions.sendStdIn( - // this._devboxId, - // this._executionId, - // { text: input }, - // options, - // ); - // } + /** + * Send input to the execution's stdin. + * + * @param input - The input to send + * @param options - Request options + */ + async sendStdIn(input: string, options?: Core.RequestOptions): Promise { + await this.client.devboxes.executions.sendStdIn( + this._devboxId, + this._executionId, + { text: input }, + options, + ); + } /** * Wait for the execution to complete and return the result. diff --git a/tests/smoketests/object-oriented/execution.test.ts b/tests/smoketests/object-oriented/execution.test.ts index 441566f90..df70b8cbb 100644 --- a/tests/smoketests/object-oriented/execution.test.ts +++ b/tests/smoketests/object-oriented/execution.test.ts @@ -90,7 +90,7 @@ describe('smoketest: object-oriented execution', () => { } }); - test.skip('start execution with stdin enabled', async () => { + test('start execution with stdin enabled', async () => { expect(devbox).toBeDefined(); execution = await devbox.cmd.execAsync({ command: 'cat', @@ -101,14 +101,10 @@ describe('smoketest: object-oriented execution', () => { expect((await execution.getState()).status).toBe('running'); }); - test.skip('send input to execution', async () => { + test('send input to execution', async () => { expect(execution).toBeDefined(); expect((await execution.getState()).status).toBe('running'); - try { - //await execution.sendStdIn('Hello from stdin!\n'); - } catch (error) { - console.error('Error sending input to execution:', error); - } + await execution.sendStdIn('Hello from stdin!\n'); // Wait a bit for the input to be processed await new Promise((resolve) => setTimeout(resolve, 1000));