Skip to content

Commit

Permalink
doc(ses-ava): update README (#2137)
Browse files Browse the repository at this point in the history
  • Loading branch information
erights authored Mar 12, 2024
1 parent 9d3a7ce commit b2843bf
Showing 1 changed file with 36 additions and 9 deletions.
45 changes: 36 additions & 9 deletions packages/ses-ava/README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,46 @@
# ses-ava
# `@endo/ses-ava`

*SES-Ava* can wrap Ava `test` functions such that errors are reported to the
console in full detail.
This compensates for how SES, with full error taming, only reveals stack traces
to debugging tools.
*SES-Ava* wraps Ava `test` functions and initializes the SES-shim with options
suitable for debugging tests. This includes logging errors to the console with
- deep stacks of prior turns
- unredacted stack traces
- unredacted error messages

To use this module, create an Ava module wrapper in your target project.
To use this module, in your Ava test files, replace

```js
import 'ses'; // or however you initialize the SES-shim
import test from 'ava';
```
with
```js
import test from '@endo/ses-ava/prepare-endo.js';
```
and add
```json
"devDependencies": {
// ...
"@endo/ses-ava": "...", // for the current version of @endo/ses-ava
// ...
},
```
specifically to "devDependencies". @endo/ses-ava itself depends on Ava as
a regular dependency, so it you include @endo/ses-ava as a regular
dependency, bundlers might bundle your code with all of Ava.

SES-Ava rhymes with Nineveh.

## Compat note

If you were already using `@endo/ses-ava` by doing

```js
import 'ses'; // or however you initialize the SES-shim
import rawTest from 'ava';
import { wrapTest } from '@endo/ses-ava';

const test = wrapTest(rawTest);
```

Then, import your test wrapper instead of Ava in your tests.

SES-Ava rhymes with Nineveh.
that code will continue to work. But it should be upgraded to the above
pattern if possible.

0 comments on commit b2843bf

Please sign in to comment.