Don't clone non-object/non-arrays, use default JS in manifest.spec.ts.
This commit is contained in:
parent
2c451d494b
commit
55699cfaff
|
@ -64,7 +64,11 @@ const getContextValue = (path: string, context: any) => {
|
||||||
if (isBackendService()) {
|
if (isBackendService()) {
|
||||||
return data
|
return data
|
||||||
} else {
|
} else {
|
||||||
return cloneDeep(data)
|
if (typeof data === "object") {
|
||||||
|
return cloneDeep(data)
|
||||||
|
} else {
|
||||||
|
return data
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import vm from "vm"
|
|
||||||
|
|
||||||
jest.mock("@budibase/handlebars-helpers/lib/math", () => {
|
jest.mock("@budibase/handlebars-helpers/lib/math", () => {
|
||||||
const actual = jest.requireActual("@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 tk from "timekeeper"
|
||||||
import { getParsedManifest, runJsHelpersTests } from "./utils"
|
import { getParsedManifest, runJsHelpersTests } from "./utils"
|
||||||
|
@ -32,9 +30,7 @@ describe("manifest", () => {
|
||||||
const manifest = getParsedManifest()
|
const manifest = getParsedManifest()
|
||||||
|
|
||||||
beforeAll(() => {
|
beforeAll(() => {
|
||||||
setJSRunner((js, context) => {
|
defaultJSSetup()
|
||||||
return vm.runInNewContext(js, context, { timeout: 1000 })
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("examples are valid", () => {
|
describe("examples are valid", () => {
|
||||||
|
|
Loading…
Reference in New Issue