RuffLIB Logo

E X P E C T

A RuffLIB library for unit testing
rough and sketchy JavaScript apps.


Typical usage:

import Expect from 'rufflib-expect'; const expect = new Expect('Mathsy Test Suite'); expect.section('Check that factorialise() works'); expect.that(`factorialise(5) // 5! = 5 * 4 * 3 * 2 * 1`, factorialise(5)).is(120); console.log(expect.render('Ansi')); function factorialise(n) { if (n === 0 || n === 1) return 1; for (let i=n-1; i>0; i--) n *= i; return n; }