mirror of https://github.com/01-edu/public.git
feat(js-checkpoint):add test for more exercise
This commit is contained in:
parent
e7054b5077
commit
012be53557
|
@ -0,0 +1,19 @@
|
|||
export const tests = []
|
||||
const t = (f) => tests.push(f)
|
||||
|
||||
// more is declared and is a function and take 1 argument
|
||||
t(() => typeof more === 'function')
|
||||
t(() => more.length === 1)
|
||||
|
||||
// more works with positive numbers
|
||||
t(() => more(5) === 6)
|
||||
t(() => more(more(more(5))) === 8)
|
||||
|
||||
// more works with negative numbers
|
||||
t(() => more(-5) === -4)
|
||||
t(() => more(more(more(-5))) === -2)
|
||||
|
||||
const rand = Math.random()
|
||||
t(() => more(rand) === rand + 1)
|
||||
|
||||
Object.freeze(tests)
|
Loading…
Reference in New Issue