Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change onError tests to test console.log not called #5306

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

patrickpatrickpatrick
Copy link
Contributor

@patrickpatrickpatrick patrickpatrickpatrick commented Sep 11, 2024

What

Update onError tests to test console.log not called. Rewrite tests to instead check to see if the mocked onError callback function was called with the correct arguments.

Why

This is a better test of overriding the default functionality of error throwing because printing to console is the default behaviour of throwing errors in initAll and createAll.

Fixes #5303

@patrickpatrickpatrick patrickpatrickpatrick changed the base branch from main to public-js-api September 11, 2024 10:58
Copy link

github-actions bot commented Sep 11, 2024

📋 Stats

File sizes

File Size
dist/govuk-frontend-development.min.css 118.52 KiB
dist/govuk-frontend-development.min.js 44 KiB
packages/govuk-frontend/dist/govuk/all.bundle.js 92.62 KiB
packages/govuk-frontend/dist/govuk/all.bundle.mjs 86.96 KiB
packages/govuk-frontend/dist/govuk/all.mjs 1.1 KiB
packages/govuk-frontend/dist/govuk/govuk-frontend-component.mjs 359 B
packages/govuk-frontend/dist/govuk/govuk-frontend.min.css 118.5 KiB
packages/govuk-frontend/dist/govuk/govuk-frontend.min.js 43.99 KiB
packages/govuk-frontend/dist/govuk/i18n.mjs 5.55 KiB
packages/govuk-frontend/dist/govuk/init.mjs 6.9 KiB

Modules

File Size (bundled) Size (minified)
all.mjs 83.33 KiB 41.81 KiB
accordion.mjs 23.83 KiB 12.39 KiB
button.mjs 6.31 KiB 2.69 KiB
character-count.mjs 22.73 KiB 9.92 KiB
checkboxes.mjs 6.16 KiB 2.83 KiB
error-summary.mjs 8.22 KiB 3.46 KiB
exit-this-page.mjs 17.43 KiB 9.26 KiB
header.mjs 4.79 KiB 2.6 KiB
notification-banner.mjs 6.59 KiB 2.62 KiB
password-input.mjs 15.48 KiB 7.25 KiB
radios.mjs 5.16 KiB 2.38 KiB
service-navigation.mjs 4.79 KiB 2.69 KiB
skip-link.mjs 4.72 KiB 2.18 KiB
tabs.mjs 10.38 KiB 6.06 KiB

View stats and visualisations on the review app


Action run for d6f0617

Tests for `onError` now don't test for not calling `console.log` (the
default behaviour for error occuring in `createAll` and `initAll`) and now
test for the mocked function being called with the correct arguments.
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-5306 September 12, 2024 13:39 Inactive
Copy link
Member

@romaricpascal romaricpascal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat! Thanks for the tidy up 🧹 ⛵

@patrickpatrickpatrick patrickpatrickpatrick merged commit 0a70233 into public-js-api Sep 12, 2024
49 checks passed
@patrickpatrickpatrick patrickpatrickpatrick deleted the change-on-error-test branch September 12, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants