Skip to content

Commit

Permalink
Explain sendTo() and "jsdomError" better
Browse files Browse the repository at this point in the history
Closes #2110.
  • Loading branch information
domenic committed Aug 13, 2018
1 parent f42751e commit 34e460b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -208,7 +208,7 @@ There is also a special event, `"jsdomError"`, which will fire with error object
- Script execution errors that are not handled by a window `onerror` event handler that returns `true` or calls `event.preventDefault()`
- Not-implemented errors resulting from calls to methods, like `window.alert`, which jsdom does not implement, but installs anyway for web compatibility

If you're using `sendTo(c)` to send errors to `c`, by default it will call `console.error` with information from `"jsdomError"` events. If you'd prefer to maintain a strict one-to-one mapping of events to method calls, and perhaps handle `"jsdomError"`s yourself, then you can do
If you're using `sendTo(c)` to send errors to `c`, by default it will call `c.error(errorStack[, errorDetail])` with information from `"jsdomError"` events. If you'd prefer to maintain a strict one-to-one mapping of events to method calls, and perhaps handle `"jsdomError"`s yourself, then you can do

```js
virtualConsole.sendTo(c, { omitJSDOMErrors: true });
Expand Down

0 comments on commit 34e460b

Please sign in to comment.