Skip to content

Test Cases

🕙 Start time⌛ Duration
4/29/2026, 4:20:07 PM8.727 s
✅ Passed❌ Failed⏩ Skipped🚧 Todo⚪ Total
Test Suites5000050
Tests139000139

16 passed, 0 failed, 0 skipped, 0 todo, done in 25.523099999999886 s

✅ function Tests › case Function
   ✅ should return the value for a true condition (simple case)
   ✅ should return the alternative value for a false condition (simple case)
   ✅ should handle multiple conditions and return the first matching value
   ✅ should return the only passed argument
   ✅ should throw an error when called without arguments
   ✅ should throw an error when called with even number of arguments
✅ function Tests › coalesce Function
   ✅ should return the first non-null/undefined value
   ✅ should return null if all values are null or undefined
   ✅ should throw on empty input
✅ function Tests › if Function
   ✅ should return the true value when the condition is true
   ✅ should return the false value when the condition is false
✅ function Tests › choose Function
   ✅ correctly returns the options at the given index: basic tests
   ✅ should throw an error when index is out of bounds
   ✅ should throw an error when index is negative
   ✅ should throw an error when no options are provided
   ✅ should throw an error when called without arguments
✅ function Tests

10 passed, 0 failed, 0 skipped, 0 todo, done in 2577.373973 s

✅ random Function
   ✅ should return either 0 or 1 when no arguments are provided (1000 iterations)
   ✅ should return a random number between min and max (inclusive of min, exclusive of max) (1000 iterations)
   ✅ should handle edge cases with negative ranges (1000 iterations)
✅ weightedRandom Function
   ✅ should return a key based on its weight
   ✅ should handle equal weights
   ✅ should handle a single key with weight
   ✅ should throw an error if the object is empty
   ✅ should throw an error if any weight is not an integer
   ✅ should throw an error if any weight is negative
   ✅ should throw an error if any weight is zero

31 passed, 0 failed, 0 skipped, 0 todo, done in 34.124250000000075 s

✅ arithmetic Transformers › add()
   ✅ should add numbers
   ✅ should add numbers from array
   ✅ should return null if no arguments provided
   ✅ should throw if any argument is not a number
✅ arithmetic Transformers › diff()
   ✅ should subtract numbers
   ✅ should throw if arguments are invalid
✅ arithmetic Transformers › mult()
   ✅ should multiply numbers
   ✅ should multiply numbers from array
   ✅ should return null if no arguments provided
   ✅ should throw if argument is NaN
✅ arithmetic Transformers › div()
   ✅ should divide numbers
   ✅ should throw if dividing by zero
   ✅ should throw if arguments are invalid
✅ arithmetic Transformers › pow()
   ✅ should raise number to power
   ✅ should throw if arguments are invalid
✅ arithmetic Transformers › inc()
   ✅ should increment number by 1
✅ arithmetic Transformers › dec()
   ✅ should decrement number by 1
✅ arithmetic Transformers › neg()
   ✅ should negate number
✅ arithmetic Transformers › inv()
   ✅ should return reciprocal value
   ✅ should throw if dividing by zero
✅ arithmetic Transformers › mod()
   ✅ should return modulus
   ✅ should throw if arguments are invalid
✅ arithmetic Transformers › trunc()
   ✅ should truncate number
   ✅ should throw if argument is invalid
✅ arithmetic Transformers › ceil()
   ✅ should round number upwards
   ✅ should throw if argument is invalid
✅ arithmetic Transformers › round()
   ✅ should round to nearest integer
   ✅ should round with precision
   ✅ should return null if number is null or undefined
   ✅ should throw if argument is NaN
   ✅ should throw if precision is invalid
✅ arithmetic Transformers

37 passed, 0 failed, 0 skipped, 0 todo, done in 67.27075599999989 s

✅ `has` predicate
   ✅ should return true if property exists in object
   ✅ should return false if property does not exist in object
   ✅ should return false for empty array
   ✅ should return false if object is null or undefined
   ✅ should throw with only 1 argument
   ✅ should return true if property exists in array
   ✅ should return false if property does not exist in array
   ✅ should return false if first argument is not a key-based object
✅ `contains` predicate
   ✅ should return true if va;ie exists in object
   ✅ should return true if value exists in array
   ✅ should return true if substring exists in string
   ✅ should return false if property does not exist in object
   ✅ should return false for empty array
   ✅ should return false if object is null or undefined
   ✅ should throw invalid 2nd argument if first one is string
   ✅ returns false with only 1 argument if array or object
   ✅ should return true if false value exists in object
   ✅ should return true if null value exists in object
   ✅ should return true if false value exists in array
   ✅ should return true if null value exists in array
✅ `and` predicate
   ✅ should return true if all conditions are true
   ✅ should return false if any condition is false
   ✅ should handle truthy and falsy values correctly
   ✅ should return true without arguments
✅ `or` predicate
   ✅ should return true if any condition is true
   ✅ should return false if all conditions are false
   ✅ should return false if all conditions are falsy
   ✅ should return true if any condition is truthy
   ✅ should return false when called without arguments
✅ `none` predicate
   ✅ should return true if none of conditions are true
   ✅ should return false if any condition is true
   ✅ should handle other falsy values as false
   ✅ should return false if any condition is a truthy value
   ✅ should return true with no arguments
✅ `not` predicate
   ✅ should return true if the condition is false
   ✅ should return false if the condition is true
   ✅ should throw if no arguments are passed or null is passed

18 passed, 0 failed, 0 skipped, 0 todo, done in 47.979509000000235 s

✅ special Math Transformers › sin()
   ✅ should return sine of a number
   ✅ should throw if argument is invalid
✅ special Math Transformers › cos()
   ✅ should return cosine of a number
   ✅ should throw if argument is invalid
✅ special Math Transformers › sqrt()
   ✅ should return square root of a number
   ✅ should throw if argument is invalid
✅ special Math Transformers › ln()
   ✅ should return natural logarithm of a number
   ✅ should return -Infinity for ln(0)
   ✅ should return Number.NaN for ln of negative number
✅ special Math Transformers › log()
   ✅ should return logarithm with given base
   ✅ should throw if base is invalid
   ✅ should throw if num is invalid
✅ special Math Transformers › lg()
   ✅ should return base-10 logarithm
   ✅ should throw if argument is invalid
✅ special Math Transformers › deg()
   ✅ should convert radians to degrees
   ✅ should throw if argument is invalid
✅ special Math Transformers › rad()
   ✅ should convert degrees to radians
   ✅ should throw if argument is invalid
✅ special Math Transformers

27 passed, 0 failed, 0 skipped, 0 todo, done in 40.95960100000002 s

✅ statistics functions › max()
   ✅ returns maximum from list of numbers
   ✅ returns maximum from array
   ✅ returns null for empty input
   ✅ throws when non-numeric passed
✅ statistics functions › min()
   ✅ returns minimum from list of numbers
   ✅ returns minimum from array
   ✅ returns null for empty input
   ✅ throws when non-numeric passed
✅ statistics functions › sum()
   ✅ returns sum from list of numbers
   ✅ returns sum from array
   ✅ returns null for empty input
   ✅ throws when non-numeric passed
✅ statistics functions › avg()
   ✅ returns average from list of numbers
   ✅ returns average from array
   ✅ returns null for empty input
✅ statistics functions › med()
   ✅ returns median for odd length
   ✅ returns median for even length
   ✅ works with array input
   ✅ returns null for empty input
   ✅ throws when non-numeric passed
✅ statistics functions › sumsq()
   ✅ returns sum of squares for list
   ✅ returns sum of squares for array
   ✅ returns null for empty input
✅ statistics functions › sumProduct()
   ✅ returns sum of products of corresponding numbers
   ✅ handles more than two lists
   ✅ returns null for empty input
   ✅ throws error on mismatched list length
✅ statistics functions