Execute sloppy code test

This commit is contained in:
Adria Navarro 2024-02-13 11:45:11 +01:00
parent 81035f6d03
commit 7e43fff018
1 changed files with 5 additions and 0 deletions

View File

@ -30,6 +30,11 @@ describe("jsRunner", () => {
expect(output).toBe(3)
})
it("it can execute sloppy javascript", async () => {
const output = await processJS(`a=2;b=3;return a + b`)
expect(output).toBe(5)
})
it("should prevent sandbox escape", async () => {
const output = await processJS(
`return this.constructor.constructor("return process")()`