X Tutup
The Wayback Machine - https://web.archive.org/web/20251020114109/https://github.com/nodejs/node/pull/60190
Skip to content

Conversation

vmoroz
Copy link
Member

@vmoroz vmoroz commented Oct 10, 2025

Make Node-API instanceof tests independent from V8 code.

Currently test/js-native-api/test_general/testInstanceOf.js test file depends on two files from the V8 code:

  • deps/v8/test/mjsunit/instanceof.js
  • deps/v8/test/mjsunit/instanceof-2.js

While it works for the Node.js project, it makes it difficult to reuse these tests for other JS engines and JS runtimes.

In this PR we copy and adapt contents of these two V8 files to testV8Instanceof.js and testV8Instanceof2.js files.
These are exactly the same tests as before, but they are now local to the test/js-native-api/test_general test.

@vmoroz vmoroz added test Issues and PRs related to the tests. node-api Issues and PRs related to the Node-API. labels Oct 10, 2025
@nodejs-github-bot nodejs-github-bot added the needs-ci PRs that need a full CI run. label Oct 10, 2025
Copy link

codecov bot commented Oct 10, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.55%. Comparing base (bfc81ca) to head (1bd8b19).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #60190   +/-   ##
=======================================
  Coverage   88.55%   88.55%           
=======================================
  Files         704      704           
  Lines      208087   208087           
  Branches    40019    40014    -5     
=======================================
+ Hits       184266   184280   +14     
+ Misses      15818    15817    -1     
+ Partials     8003     7990   -13     

see 30 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@legendecas legendecas moved this from Need Triage to In Progress in Node-API Team Project Oct 10, 2025
// The following assert functions are referenced by v8's unit tests
// See for instance deps/v8/test/mjsunit/instanceof.js

function assertTrue(assertion) {
Copy link
Member

Choose a reason for hiding this comment

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

I think we can update these tests to incorporate Node.js test patterns.

It's unlikely we will sync the these test files from V8 again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. node-api Issues and PRs related to the Node-API. test Issues and PRs related to the tests.

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup