mirror of https://github.com/01-edu/public.git
hamzaelkhatri
1 year ago
1 changed files with 19 additions and 0 deletions
@ -0,0 +1,19 @@ |
|||||||
|
export const tests = [] |
||||||
|
const t = (f) => tests.push(f) |
||||||
|
|
||||||
|
|
||||||
|
// add is declared and is a function and take 2 arguments
|
||||||
|
t(() => typeof Add === 'function') |
||||||
|
t(() => Add.length === 2) |
||||||
|
|
||||||
|
// add works with positive numbers
|
||||||
|
t(() => Add(5, 6) === 11) |
||||||
|
|
||||||
|
// Add works with negative numbers
|
||||||
|
t(() => Add(-5, -6) === -11) |
||||||
|
|
||||||
|
// Add works with mixed numbers
|
||||||
|
t(() => Add(-5, 6) === 1) |
||||||
|
|
||||||
|
// Add works with zero
|
||||||
|
t(() => Add(0, 0) === 0) |
Loading…
Reference in new issue