Lint
This commit is contained in:
parent
1439eb9b27
commit
843d95c3bb
|
@ -18,11 +18,13 @@ jest.mock("@budibase/handlebars-helpers/lib/uuid", () => {
|
|||
})
|
||||
|
||||
import { processStringSync, encodeJSBinding } from "@budibase/string-templates"
|
||||
|
||||
const { runJsHelpersTests } = require("@budibase/string-templates/test/utils")
|
||||
|
||||
import tk from "timekeeper"
|
||||
import { init } from ".."
|
||||
import TestConfiguration from "../../tests/utilities/TestConfiguration"
|
||||
|
||||
tk.freeze("2021-01-21T12:00:00")
|
||||
|
||||
describe("jsRunner", () => {
|
||||
|
|
|
@ -13,7 +13,7 @@ function tryParseJson(str) {
|
|||
}
|
||||
|
||||
try {
|
||||
return JSON.parse(str.replace(/\'/g, '"'))
|
||||
return JSON.parse(str.replace(/'/g, '"'))
|
||||
} catch (e) {
|
||||
return
|
||||
}
|
||||
|
@ -34,7 +34,7 @@ const getParsedManifest = () => {
|
|||
}
|
||||
|
||||
// Trim 's
|
||||
js = js.replace(/^\'|\'$/g, "")
|
||||
js = js.replace(/^'|'$/g, "")
|
||||
let parsedExpected
|
||||
if ((parsedExpected = tryParseJson(js))) {
|
||||
if (Array.isArray(parsedExpected)) {
|
||||
|
@ -97,7 +97,7 @@ module.exports.runJsHelpersTests = ({ funcWrap, testsToSkip } = {}) => {
|
|||
new RegExp(escapeRegExp(arrayString)),
|
||||
`array${i}`
|
||||
)
|
||||
context[`array${i}`] = JSON.parse(arrayString.replace(/\'/g, '"'))
|
||||
context[`array${i}`] = JSON.parse(arrayString.replace(/'/g, '"'))
|
||||
})
|
||||
|
||||
let convertedJs = convertToJS(hbs)
|
||||
|
|
Loading…
Reference in New Issue