Better typing

This commit is contained in:
Adria Navarro 2024-02-01 10:56:59 +01:00
parent e6ae364918
commit 82db76627f
2 changed files with 7 additions and 2 deletions

View File

@ -27,6 +27,7 @@ describe("jsRunner", () => {
const config = new TestConfiguration()
beforeAll(async () => {
// Register js runner
init()
await config.init()
})
@ -42,5 +43,7 @@ describe("jsRunner", () => {
expect(output).toBe(3)
})
runJsHelpersTests((func: any) => config.doInContext(config.getAppId(), func))
runJsHelpersTests({
funcWrap: (func: any) => config.doInContext(config.getAppId(), func),
})
})

View File

@ -60,7 +60,9 @@ const getParsedManifest = () => {
}
module.exports.getParsedManifest = getParsedManifest
module.exports.runJsHelpersTests = (funcWrap = delegate => delegate()) => {
module.exports.runJsHelpersTests = (
{ funcWrap } = { funcWrap: delegate => delegate() }
) => {
const manifest = getParsedManifest()
const processJS = (js, context) => {