ONSdigital / design-system

ONS Design System
https://service-manual.ons.gov.uk/design-system
MIT License
28 stars 17 forks source link

Ignore build files from Jest tests #3155

Closed rmccar closed 2 months ago

rmccar commented 2 months ago

What is the context of this PR?

Fixes: #2941

If build files are present in your local repo after running yarn cdn-bundle command running yarn test will have some failing tests which fail on some JS imports. This is down to the files in the build directory also being run by jest but because these files are copies of the actual ones we want to run. But because these copies are in a different directory and the imports are using relative paths these paths no longer work so the tests fail.

This PR changes the Jest config so that those files in the build and templates folders are ignored by Jest, we don't want to run the tests in these folders as we would be running the same tests twice.

How to review this PR

Checklist

This needs to be completed by the person raising the PR.

netlify[bot] commented 2 months ago

Deploy Preview for ons-design-system-preview ready!

Name Link
Latest commit 9946f1639fbe472c8bfa91f992602232d826af21
Latest deploy log https://app.netlify.com/sites/ons-design-system-preview/deploys/662b6dccebc161000850ed25
Deploy Preview https://deploy-preview-3155--ons-design-system-preview.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.