UWHealth/netlify-plugin-jest

catch ALL errors and set status to error if necessary.

moop-moop opened this issue · 0 comments

Thanks for reporting this bug!

If this is related to a typo or the documentation being unclear, please click on
the relevant page's Edit button (pencil icon) and suggest a correction
instead.

Please search other issues to make sure this bug has not already been reported.

Then fill in the sections below.

the plugin fails to run due to an unhandled error, the status stays at pending.

A clear and concise description of what the bug is.

Steps to reproduce

Step-by-step instructions on how to reproduce the behavior.

build with the plugin and have an unhandled error. likely an error outside of the main function.

Expected behavior

Expect all errors to to trigger the status set to error.

Configuration

Command line options and/or configuration file, if any.

Environment

Enter the following command in a terminal and copy/paste its output:

Can you submit a pull request?

  • Yes.

Solution

use the onError: run only when an error occurs in the build stage, failing the build; before deploy begins. as part of Netlify build plugs methods. It happens for all errors. so the main caught errors will need to a way to flag the status has already been set accordingly.