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

assert: make partialDeepStrictEqual work with urls and File prototypes #56231

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

puskin94
Copy link
Contributor

this PR should close the gap between assert.deepStrictEqual and assert.partialDeepStrictEqual even more.

Found a couple more cases that were not properly working:

  • URLs were not properly compared
  • it was not passing when comparing Object.getPrototypeOf(File.prototype) and Blob.prototype
  • new Float32Array([+0.0]) and new Float32Array([-0.0]) were considered equal, which is not the case

@nodejs-github-bot nodejs-github-bot added assert Issues and PRs related to the assert subsystem. needs-ci PRs that need a full CI run. labels Dec 11, 2024
@BridgeAR BridgeAR added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. request-ci Add this label to start a Jenkins CI on a PR. labels Dec 11, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Dec 11, 2024
@nodejs-github-bot
Copy link
Collaborator

Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.52%. Comparing base (9ec8b9e) to head (943cb6d).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #56231      +/-   ##
==========================================
- Coverage   88.54%   88.52%   -0.02%     
==========================================
  Files         657      657              
  Lines      189899   189975      +76     
  Branches    36465    36488      +23     
==========================================
+ Hits       168140   168170      +30     
- Misses      14966    14994      +28     
- Partials     6793     6811      +18     
Files with missing lines Coverage Δ
lib/assert.js 99.37% <100.00%> (+<0.01%) ⬆️

... and 33 files with indirect coverage changes

@@ -271,6 +271,16 @@ describe('Object Comparison Tests', () => {
actual: { dataView: new Uint8Array(3) },
expected: { dataView: new DataView(new ArrayBuffer(3)) },
},
{
describe: 'throws when comparing Float32Array([+0.0]) with Float32Array([-0.0])',
Copy link

Choose a reason for hiding this comment

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

Suggested change
describe: 'throws when comparing Float32Array([+0.0]) with Float32Array([-0.0])',
description: 'throws when comparing Float32Array([+0.0]) with Float32Array([-0.0])',

Copy link
Contributor Author

Choose a reason for hiding this comment

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

🤦 this must have been the autocomplete ... thanks 😄

@puskin94 puskin94 force-pushed the partial-deep-strict-equal-missing-cases branch from 40e6cba to 943cb6d Compare December 11, 2024 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assert Issues and PRs related to the assert subsystem. author ready PRs that have at least one approval, no pending requests for changes, and a CI started. needs-ci PRs that need a full CI run.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants