
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
@uwhealth-public/netlify-plugin-jest
Advanced tools
Netlify Build plugin - Netlify plugin to run Jest unit tests and set status in GitHub.
Netlify build plugin to run Jest unit tests and set a simple status in GitHub on the pull request/commit that triggered the build. Failed tests will stop the build so no build time is wasted.
Tests are not run if it's determined there are no commits. This determination is made based solely on Git not based on the history of the Netlify builds themselves. See: Netlify Plugins - Git Utility
Jest unit tests are run via a simple command line before the build (onPrebuild). The json results are extracted to get some summary info. GitHub status messages are set when tests start and with the summary when finished. If the tests fail, the plugin cancels the build. If there are plugin or other errors the build will be failed. Otherwise, the build will proceed.
The Github status details link will go to the Netlify deploy log, so someone can see details on the failed tests or errors.
npm install netlify-plugin-jest
Add this plugin to the plugins array in your
netlify.toml configuration file:
[[plugins]]
package = "netlify-plugin-jest"
[plugins.inputs]
# all inputs for this plugin are required, but have default values
The plugin requires a GitHub personal access token to be set as an environment variable named GITHUB_PERSONAL_TOKEN . It is used to set a simple GitHub repo status.
NETLIFY_PLUGIN_JEST_EXTRA_LOGGING= true. Setting this environment variable will cause the plugin to display extra logging details. This allows Nelifty site builds to temporarily display plugin extra logging for troubleshooting.
NETLIFY_PLUGIN_JEST_FORCE_TESTS = true. Setting this environemnt variable will cause the plugin to run tests regardless of whether any commits exist indicating a changed build.
Checks if configured to skip tests
Sets a GitHub status of pending/running...
Run the testing command
Determine success, plugin error or testing failure. Testing failure is soley
deteremined by the presence of the testFailureErrorMessage string in the
error response. This is because all regular testing failures are still
returned as errors.
If success: a. Set the GitHub status b. Continue on building
If testing failure: a. Parse the test results that are written to a json file and construct a short summary for the GitHub status. b. Set the GitHub status c. Cancel the Netlify build
If other error: a. Set the GitHub status b. Fail the Netlify build
The plugin can be developed locally most easily by including it as a relative path in another locally functioning Netlify site that is linked to Netlify.
[[plugins]]
package = "..\\netlify-plugins\\netlify-plugin-jest\\"
[plugins.inputs]
extraLogging = true
[[plugins]]
package = "@netlify/plugin-local-install-core"
Remember the GITHUB_PERSONAL_TOKEN needs to be set in the local Netlify site not
the plugin itself. This will allow netlify build on the Netlify site (not the
plugin) to run the plugin. It will also set the status on the commit for the the
site's repo if there is a pull request present. Not all Netlify environment
values are present locally: DEPLOY_URL etc.
The plugin can be tested without using an actual released npm package by doing the following:
Figure out the branch/tag/commit etc of the plugin to test, and install it as
a package in the Netlify site you will use for testing:
npm install UWHealth/netlify-plugin-jest#<branch/tag/commit>
Change the Netlify site's toml configuration:
[[plugins]]
package = "./node_modules/netlify-plugin-jest"
[plugins.inputs]
extraLogging = true
[[plugins]]
package = "@netlify/plugin-local-install-core"
Make sure to clear the build/deploy cache when you build/redeploy the testing
site on Netlify. This will pull down a clean copy of the plugin code from the
branch/tag/commit specified in the package.json after the npm install.
Uninstall the Github sourced npm afterwards if the site is to be used for production purposes.
Configure the plugin to use a Github App.
Set test failure information as annotations on files in the form of more advanced GitHub Status Check.
Display Jest testing coverage information on GitHub repo.
FAQs
Netlify Build plugin - Netlify plugin to run Jest unit tests and set status in GitHub.
The npm package @uwhealth-public/netlify-plugin-jest receives a total of 8 weekly downloads. As such, @uwhealth-public/netlify-plugin-jest popularity was classified as not popular.
We found that @uwhealth-public/netlify-plugin-jest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.