feat(js-checkpoint):add test for jabs exercise

This commit is contained in:
root 2023-10-02 13:26:51 +01:00
parent e7054b5077
commit ec30b921b6
1 changed files with 18 additions and 0 deletions

18
js/tests/jabs_test.js Normal file
View File

@ -0,0 +1,18 @@
Math.abs = undefined
// /*/ // ⚡
export const tests = []
const t = (f) => tests.push(f)
t(() => isPositive(3))
t(() => isPositive(1998790))
t(() => !isPositive(-1))
t(() => !isPositive(-0.7))
t(() => !isPositive(-787823))
t(() => !isPositive(0))
t(({ eq }) => eq(abs(0), 0))
t(({ eq }) => eq(abs(-1), 1))
t(({ eq }) => eq(abs(-13.2), 13.2))
t(({ eq }) => eq(abs(132), 132))
Object.freeze(tests)