jest-puppeteer icon indicating copy to clipboard operation
jest-puppeteer copied to clipboard

Document exitOnPageError

Open LandonSchropp opened this issue 4 years ago • 0 comments

🚀 Feature Proposal

Add documentation for exitOnPageError to the readme.

Motivation

Our application's API uses 400-level errors as normal indicators of application behavior. For example, if a user's login credentials are not valid, the server responds with a 401 error. We spent quite a while trying to figure out why our specs were failing with this error:

Error: Request failed with status code 401

It looks like this is the intended behavior of jest-puppeteer, which is confusing to me in a testing context. We stumbled on the exitOnPageError option, which seemed to solve the problem.

It's very possible that we're missing something else in how our tests are structured or how this is intended to work.

Example

We would use this (and other configuration options) to configure jest-puppeteer.

Pitch

Documentation never hurts. 🙂

LandonSchropp avatar Jun 09 '20 19:06 LandonSchropp