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

feat(expect): Add equality support for Array Buffers to ToStrictEqual method #11805

Merged
merged 13 commits into from Sep 29, 2021

Conversation

khai93
Copy link
Contributor

@khai93 khai93 commented Sep 2, 2021

Summary

Adds equality checks for Array Buffers in ToStrictEqual method, Fixes #11770.

Test plan

The changes add a new entry to the array toStrictEqualTesters in expect package's matchers.ts and a new util function arrayBufferEquality. I've added tests in matchers.test.js to test the actual method and tests in utils.test.ts to test the util function.

@codecov-commenter
Copy link

codecov-commenter commented Sep 2, 2021

Codecov Report

Merging #11805 (41cc53d) into master (98f10e6) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #11805      +/-   ##
==========================================
+ Coverage   69.04%   69.06%   +0.02%     
==========================================
  Files         312      312              
  Lines       16366    16377      +11     
  Branches     4746     4749       +3     
==========================================
+ Hits        11300    11311      +11     
  Misses       5039     5039              
  Partials       27       27              
Impacted Files Coverage Δ
packages/expect/src/matchers.ts 97.86% <ø> (ø)
packages/expect/src/utils.ts 95.83% <100.00%> (+0.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 98f10e6...41cc53d. Read the comment docs.

Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

Thanks! Implementation looks good, just some formatting and type suggestions 🙂

CHANGELOG.md Outdated Show resolved Hide resolved
packages/expect/src/utils.ts Outdated Show resolved Hide resolved
packages/expect/src/utils.ts Outdated Show resolved Hide resolved
packages/expect/src/utils.ts Outdated Show resolved Hide resolved
packages/expect/src/utils.ts Outdated Show resolved Hide resolved
khai93 and others added 5 commits September 2, 2021 06:24
Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com>
Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com>
Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com>
Co-authored-by: Simen Bekkhus <sbekkhus91@gmail.com>
@khai93 khai93 requested a review from SimenB September 2, 2021 11:36
@SimenB
Copy link
Member

SimenB commented Sep 8, 2021

Can you fix the eslint errors?

@khai93
Copy link
Contributor Author

khai93 commented Sep 8, 2021

Can you fix the eslint errors?

Done.

@SimenB SimenB merged commit 94734e1 into jestjs:main Sep 29, 2021
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handling of ArrayBuffer in .toStrictEqual()
4 participants