Skip to content

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

Merged
iuioiua merged 2 commits into
mainfrom
assert-remove-assertEquals-formatter
Jun 3, 2024
Merged

iuioiua merged 2 commits into
mainfrom
assert-remove-assertEquals-formatter

Conversation

@iuioiua

@iuioiua iuioiua commented May 30, 2024 •

Copy link
Copy Markdown
Contributor

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

kt3k commented Jun 2, 2024

Copy link
Copy Markdown
Contributor

I think #4930 unblocks this PR

Comment thread testing/asserts.ts Resolved
@codecov

codecov Bot commented Jun 2, 2024 •

Copy link
Copy Markdown

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.

@kt3k kt3k left a comment

Copy link
Copy Markdown
Contributor

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
@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