Draft
Conversation
Enumerates all 58 test directories from Node.js's test/js-native-api and test/node-api, rates each by porting difficulty (Easy/Medium/Hard), and documents special considerations for tests with deep runtime dependencies (libuv, worker threads, SEA, node_api_post_finalizer, etc.). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds the following to the Node.js implementor and harness in preparation for porting the easy js-native-api tests: - assert.js: expose assert.ok, .strictEqual, .notStrictEqual, .deepStrictEqual, and .throws as methods on the global assert object - gc.js: new module providing a global gcUntil(name, condition) helper that drives GC until a condition is met (needed for finalizer tests) - tests.ts: inject --expose-gc and gc.js into every test subprocess - CMakeLists.txt: broaden add_node_api_cts_addon() to accept multiple source files via ARGN (needed for multi-file addons) - tests/harness/assert.js: exercise all new assert methods - tests/harness/gc.js: exercise gcUntil pass and failure paths Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Port all "Easy" difficulty engine-specific tests from Node.js: 3_callbacks, 4_object_factory, 5_function_factory, 7_factory_wrap, 8_passing_wrapped, test_array, test_bigint, test_dataview, test_date, test_handle_scope, test_instance_data, test_new_target, test_number, test_promise, test_properties, test_reference_double_free, test_symbol. C/C++ sources are copied from Node.js with minimal changes (entry_point.h macro). JS tests are adapted to use CTS globals (loadAddon, assert, gcUntil) instead of Node.js test harness (common.js, require). test_dataview: removed SharedArrayBuffer tests that depend on experimental node_api_is_sharedarraybuffer API (not in stable node-api-headers). Also updates node-api-headers from 1.7.0 to 1.8.0. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Mark 17 easy js-native-api tests as Ported (test_dataview as Partial due to missing experimental SharedArrayBuffer APIs in node-api-headers). Add "Experimental Node-API Features" section documenting which tests depend on experimental APIs not yet available in node-api-headers, and the approach needed to support them. References nodejs#26. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Exercises napi_define_class with method, data value, accessor, and static property descriptors. Includes null-argument tests for napi_define_class via test_null.c/test_null.js. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
This PR is stacked on #25 and should not be reviewed or merged until that PR lands.
Summary
Ports
test_constructorfrom the Node.js test suite to the CTS.napi_define_classwith method, value, accessor, and static property descriptorsnapi_define_class(viatest_null.c/test_null.js)test.js,test2.js,test_null.jsTest plan
npm run addons:configure && npm run addons:build— compiles cleanlynpm run node:test— all test files pass🤖 Generated with Claude Code