Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Add tests

Jakub Novak6f4cde66ab0a
diff --git a/packages/js-sdk/test/process.test.mjs b/packages/js-sdk/test/process.test.mjs
index c0781078f..33748ca6d 100644
--- a/packages/js-sdk/test/process.test.mjs
+++ b/packages/js-sdk/test/process.test.mjs
@@ -125,3 +125,15 @@ test('test default on stdout/stderr', async () => {
await sandbox.close()
}, 10000)
+
+
+
+test('test process start and wait', async () => {
+ const sandbox = await Sandbox.create(id)
+
+ const output = await sandbox.process.startAndWait('node -e "console.log(\'Hello\');"')
+
+ expect(output.exitCode).toEqual(0)
+
+ await sandbox.close()
+})
diff --git a/packages/python-sdk/tests/test_process.py b/packages/python-sdk/tests/test_process.py
index fdd6ebc3f..a8e85052a 100644
--- a/packages/python-sdk/tests/test_process.py
+++ b/packages/python-sdk/tests/test_process.py
@@ -125,3 +125,17 @@ def test_process_default_on_stdout_stderr():
assert proc.exit_code == 1
sandbox.close()
+
+
+def test_process_start_and_wait():
+ sandbox = Sandbox()
+ code = "node -e \"console.log('hello');\""
+
+ output = sandbox.process.start_and_wait(code)
+
+ proc = sandbox.process.start(code)
+ proc.wait()
+
+ assert output.exit_code == 0
+
+ sandbox.close()