Skip to content

BREAKING(assert,testing): remove formatter option from assertEquals() #4893

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

Merged
merged 2 commits into from
Jun 3, 2024

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented May 30, 2024

What's changed

This change removes the option argument from assertEquals(). The only option within this argument was formatter, which allowed the user to format the actual and expected strings before being internally processed for display after they were determined to not be equal.

Why has this change been made

This argument was removed because it didn't seem to have many use cases outside of some code previously internal to the Standard Library. The function's built-in formatter performs its job fine.

Migration guide

To migrate, simply remove the options argument from assertEquals():

  import { assertEquals } from "@std/assert/assert-equals";

- assertEquals("hello", "world", {
-   formatter(text) => myCustomFormatter(text),
- });
+ assertEquals("hello", "world");

@iuioiua iuioiua marked this pull request as ready for review June 2, 2024 01:58
@iuioiua iuioiua requested a review from kt3k as a code owner June 2, 2024 01:58
@kt3k
Copy link
Member

kt3k commented Jun 2, 2024

I think #4930 unblocks this PR

Copy link

codecov bot commented Jun 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.12%. Comparing base (44bc900) to head (a8ad248).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4893      +/-   ##
==========================================
- Coverage   92.12%   92.12%   -0.01%     
==========================================
  Files         487      487              
  Lines       38763    38761       -2     
  Branches     5388     5388              
==========================================
- Hits        35710    35708       -2     
  Misses       2997     2997              
  Partials       56       56              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM

@iuioiua iuioiua merged commit 8b24cc7 into main Jun 3, 2024
12 checks passed
@iuioiua iuioiua deleted the assert-remove-assertEquals-formatter branch June 3, 2024 03:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants