Don't clone non-object/non-arrays, use default JS in manifest.spec.ts.

This commit is contained in:
Sam Rose 2024-10-07 12:23:22 +01:00
parent 2c451d494b
commit 55699cfaff
No known key found for this signature in database
2 changed files with 7 additions and 7 deletions

View File

@ -64,7 +64,11 @@ const getContextValue = (path: string, context: any) => {
if (isBackendService()) {
return data
} else {
if (typeof data === "object") {
return cloneDeep(data)
} else {
return data
}
}
}

View File

@ -1,5 +1,3 @@
import vm from "vm"
jest.mock("@budibase/handlebars-helpers/lib/math", () => {
const actual = jest.requireActual("@budibase/handlebars-helpers/lib/math")
@ -17,7 +15,7 @@ jest.mock("@budibase/handlebars-helpers/lib/uuid", () => {
}
})
import { processString, setJSRunner } from "../src/index"
import { defaultJSSetup, processString } from "../src/index"
import tk from "timekeeper"
import { getParsedManifest, runJsHelpersTests } from "./utils"
@ -32,9 +30,7 @@ describe("manifest", () => {
const manifest = getParsedManifest()
beforeAll(() => {
setJSRunner((js, context) => {
return vm.runInNewContext(js, context, { timeout: 1000 })
})
defaultJSSetup()
})
describe("examples are valid", () => {