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

fix(node/assert): port more test cases from node #16895

Merged
merged 24 commits into from
Feb 6, 2025

Conversation

DonIsaac
Copy link
Contributor

@DonIsaac DonIsaac commented Jan 30, 2025

What does this PR do?

Ports most remaining node:assert unit tests from node.

  • test-assert-calltracker-getCalls
  • test-assert-calltracker-calls
  • test-assert-calltracker-report
  • test-assert-calltracker-verify
  • test-assert-checktag
  • test-assert-esm-cjs-message-verify
  • test-assert-fail
  • test-assert-if-error
  • test-assert-deep-with-error

Tests that still need to be ported are:

  • test-assert-async
  • test-assert-deep
  • test-assert-fail-deprecation
  • test-assert-first-line
  • test-assert-objects
  • test-assert-typedarray-deepequal

These require a good deal of refactoring and will be added in another PR.

How did you verify your code works?

There are tests.

@robobun
Copy link

robobun commented Jan 30, 2025

Updated 4:44 PM PT - Feb 5th, 2025

@DonIsaac, your commit d8f51f6 has 2 failures in Build #11149:


🧪   try this PR locally:

bunx bun-pr 16895

@DonIsaac DonIsaac changed the title Don/fix/node assert fix(node/assert): port remaining test cases from node Jan 30, 2025
@DonIsaac
Copy link
Contributor Author

test-assert-checktag needs #16894 to land.

@DonIsaac DonIsaac changed the title fix(node/assert): port remaining test cases from node fix(node/assert): port more test cases from node Jan 31, 2025
@DonIsaac DonIsaac marked this pull request as ready for review January 31, 2025 00:54
@DonIsaac DonIsaac requested a review from dylan-conway January 31, 2025 02:29
Copy link
Member

@dylan-conway dylan-conway left a comment

Choose a reason for hiding this comment

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

Inside Bun__deepEquals when we are checking JSMapType equality we should have a RETURN_IF_EXCEPTION check after each Bun__deepEquals. Same with JSSetType. The other deep equals calls should be okay as they are because they immediately return on false

@dylan-conway
Copy link
Member

Ah, that's now inside specialObjectsDequal

@DonIsaac DonIsaac requested a review from dylan-conway February 5, 2025 21:07
@DonIsaac
Copy link
Contributor Author

DonIsaac commented Feb 5, 2025

It looks like Buffer instances use the same structure, class info, and JSType as the typed array they're constructed from. Since changing that is in a fully separate part of the codebase, I'll make that change in a follow-up pr.

Copy link
Member

@dylan-conway dylan-conway left a comment

Choose a reason for hiding this comment

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

Left a few suggestions.

nit: the object equality code shouldn't be duplicated. Might be best to split it into template function with bool skipStackProp, but that can happen in a future pr

DonIsaac and others added 3 commits February 5, 2025 15:49
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
@DonIsaac
Copy link
Contributor Author

DonIsaac commented Feb 6, 2025

@dylan-conway feel free to merge this PR whenever you're ready

@Jarred-Sumner Jarred-Sumner merged commit 146ec77 into main Feb 6, 2025
65 of 69 checks passed
@Jarred-Sumner Jarred-Sumner deleted the don/fix/node-assert branch February 6, 2025 22:30
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.

4 participants