In most javascript test frameworks (including ava) assertion methods are simply functions that throws an error if the asserted condition is not met.
For example the method:
t.true(x, "x must be true");
will simply throw an error if the value of x is 1 or "hello" or false etc. As long as the value of x is not true t.true() will throw an error.
The way most js test frameworks work is to catch all thrown errors and output a nice report.