This commit is contained in:
Martin McKeaveney 2025-01-31 18:02:35 +00:00
parent b0e38be844
commit 4736c8f5c7
1 changed files with 2 additions and 2 deletions

View File

@ -112,10 +112,10 @@ describe("Test isolated vm directly", () => {
const context = {} const context = {}
// throw error // throw error
// Ensure the first execution throws an error // Ensure the first execution throws an error
expect(() => runJSWithIsolatedVM(`test.foo.bar = 123`, context)).toThrow(); expect(() => runJSWithIsolatedVM(`test.foo.bar = 123`, context)).toThrow()
// Ensure the error is not persisted across VMs // Ensure the error is not persisted across VMs
const secondResult = runJSWithIsolatedVM(`return {}`, context); const secondResult = runJSWithIsolatedVM(`return {}`, context)
expect(secondResult).toEqual({}) expect(secondResult).toEqual({})
}) })
}) })