expect to throw
This commit is contained in:
parent
6999bdf57e
commit
b0e38be844
|
@ -111,10 +111,11 @@ describe("Test isolated vm directly", () => {
|
||||||
it("should ensure error results are cleared between runs", () => {
|
it("should ensure error results are cleared between runs", () => {
|
||||||
const context = {}
|
const context = {}
|
||||||
// throw error
|
// throw error
|
||||||
const result = runJSWithIsolatedVM(`test.foo.bar = 123`, context)
|
// Ensure the first execution throws an error
|
||||||
expect(result).toEqual({})
|
expect(() => runJSWithIsolatedVM(`test.foo.bar = 123`, context)).toThrow();
|
||||||
// ensure error not persisted across vms
|
|
||||||
const secondResult = runJSWithIsolatedVM(`return {}`, context)
|
// Ensure the error is not persisted across VMs
|
||||||
|
const secondResult = runJSWithIsolatedVM(`return {}`, context);
|
||||||
expect(secondResult).toEqual({})
|
expect(secondResult).toEqual({})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue