Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Cleanup tests only in debug

Jakub Dobrý51e8f186e66c
diff --git a/packages/js-sdk/tests/sandbox/files/watch.test.ts b/packages/js-sdk/tests/sandbox/files/watch.test.ts
index 904e7a200..e585405cb 100644
--- a/packages/js-sdk/tests/sandbox/files/watch.test.ts
+++ b/packages/js-sdk/tests/sandbox/files/watch.test.ts
@@ -1,6 +1,6 @@
import { expect, onTestFinished } from 'vitest'
-import { sandboxTest } from '../../setup.js'
+import { isDebug, sandboxTest } from '../../setup.js'
import { FilesystemEventType, NotFoundError, SandboxError } from '../../../src'
sandboxTest('watch directory changes', async ({ sandbox }) => {
@@ -39,7 +39,9 @@ sandboxTest('watch recursive directory changes', async ({ sandbox }) => {
const newContent = 'This file has been modified.'
await sandbox.files.makeDir(`${dirname}/${nestedDirname}`)
- onTestFinished(() => sandbox.files.remove(dirname))
+ if (isDebug) {
+ onTestFinished(() => sandbox.files.remove(dirname))
+ }
await sandbox.files.write(`${dirname}/${nestedDirname}/${filename}`, content)
@@ -72,7 +74,9 @@ sandboxTest('watch recursive directory after nested folder addition', async ({ s
const content = 'This file will be watched.'
await sandbox.files.makeDir(dirname)
- onTestFinished(() => sandbox.files.remove(dirname))
+ if (isDebug) {
+ onTestFinished(() => sandbox.files.remove(dirname))
+ }
let triggerFile: () => void
let triggerFolder: () => void