Skip to content

Two test gaps: unverified prebuild Info.plist and a missing .node fixture in the Babel plugin tests #424

Closed

Description

@kraenhansen

Two TODOs marked tests that asserted less than they appeared to. Both are now fixed on main and next.

verify-prebuilds skipped the Info.plist it just found

packages/node-addon-examples/scripts/verify-prebuilds.mts walked each framework in the XCFramework and continued past Info.plist without reading it. That file is written by writeFrameworkInfoPlist in packages/host/src/node/prebuilds/apple.ts, and a wrong CFBundleExecutable or CFBundleIdentifier passes every build step and then fails at load time on device. The script now validates Info.plist with a zod schema.

"does not touch required JS files" didn't prove what it claimed

The fixture in packages/host/src/node/babel-plugin/plugin.test.ts had my-addon.js but no sibling my-addon.node, so the assertion passed for the wrong reason. Completing the fixture exposed a real bug: isNodeApiModule in packages/host/src/node/path-utils.ts accepted an existing <path>.node before considering a .js/.json file beside it, so require('./my-addon') was rewritten to requireNodeAddon(...). The .js/.json-before-.node precedence now lives in isNodeApiModule and the plugin test has the sibling addon.

Resolution

Fixed by #426 (8d125fa), released via #471, and merged from main into next, where neither TODO remains. The competing implementations (#467 and earlier attempts) are closed.

Activity

  1. huytdps13400 commented on Aug 23, 2026

    @huytdps13400
    Contributor

    Fix PR is open: #455.

    Completing the Babel fixture exposed an actual precedence bug: require("./my-addon") was transformed to requireNodeAddon(...) even with my-addon.js beside my-addon.node. The PR now preserves Node JS/JSON resolution before addon rewriting.

    It also parses generated framework plists, verifies executable and bundle ID, and adds three portable verifier tests to the root test gate. Local evidence: 10/10 focused Babel tests, 3/3 plist verifier tests, and 88/88 across the root test command.

  2. added 4 commits that reference this issue on Oct 11, 2026
    ded6da2
    a618b35
    1ff15bf
    8d125fa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    AutomatableAn issue we expect to be fixed using automation.good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions