-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |