Test random helper

This commit is contained in:
Adria Navarro 2024-02-01 11:17:55 +01:00
parent 2899c4f7f8
commit 1b88700d02
1 changed files with 11 additions and 0 deletions

View File

@ -58,5 +58,16 @@ describe("jsRunner", () => {
expect(isValidUUID(result)).toBe(true)
})
})
describe("random", () => {
it("random helper returns a valid number", async () => {
const min = 1
const max = 8
const result = await processJS(`return helpers.random(${min}, ${max})`)
expect(result).toBeDefined()
expect(result).toBeGreaterThanOrEqual(min)
expect(result).toBeLessThanOrEqual(max)
})
})
})
})