Move sandbox escape test to server

This commit is contained in:
Adria Navarro 2024-02-09 10:35:58 +01:00
parent 7aee57eb6a
commit 0db98f7fb1
2 changed files with 7 additions and 7 deletions

View File

@ -47,6 +47,13 @@ describe("jsRunner", () => {
expect(output).toBe(3)
})
it("should prevent sandbox escape", async () => {
const output = await processJS(
`return this.constructor.constructor("return process")()`
)
expect(output).toBe("Error while executing JS")
})
describe("helpers", () => {
runJsHelpersTests({
funcWrap: (func: any) => config.doInContext(config.getAppId(), func),

View File

@ -142,13 +142,6 @@ describe("Javascript", () => {
const output = processJS(`return process`)
expect(output).toBe("Error while executing JS")
})
it("should prevent sandbox escape", () => {
const output = processJS(
`return this.constructor.constructor("return process")()`
)
expect(output).toBe("Error while executing JS")
})
})
describe("check JS helpers", () => {