The ava test function takes a callback argument of the form t => {...} or async t => {...}. If the outcome of this function indicates an error, either by throwing or by eventually rejecting a returned promise, ava does its own console-like display of this error and its stacktrace. However, it does not use the SES console and so misses out on features such as unredaction.

To use this package, a test file replaces the line

import test from 'ava';

with

import { wrapTest } from '@endo/ses-ava';
import rawTest from 'ava';

const test = wrapTest(rawTest);

Then the calls to test in the rest of the test file will act like they used to, except that, if a test fails because the test function (the callback argument to test) throws or returns a promise that eventually rejects, the error is first sent to the logger (which defaults to using the SES-aware console.error) before propagating into rawTest.