Skip to content

test: add regression coverage for @paypal/paypal-js sdk-v6 subpath (issue #599)#600

Draft
styfle wants to merge 2 commits into
mainfrom
styfle-ai/paypal-js-sdk-v6-test-599-2541
Draft

test: add regression coverage for @paypal/paypal-js sdk-v6 subpath (issue #599)#600
styfle wants to merge 2 commits into
mainfrom
styfle-ai/paypal-js-sdk-v6-test-599-2541

Conversation

@styfle

@styfle styfle commented Jul 6, 2026

Copy link
Copy Markdown
Member

Summary

Adds regression test coverage for #599, where @paypal/paypal-js@10.0.1 exposes the ./sdk-v6 subpath with only "types" + "import" conditions (no "default" or "require").

The reported failure is a runtime SyntaxError when Node resolves @paypal/paypal-js/sdk-v6 to the main entry (dist/esm/paypal-js.js) instead of the v6 entry (dist/v6/esm/paypal-js.js), causing the named export loadCoreSdkScript to be missing.

Changes

  • Unit test (test/unit/paypal-js-sdk-v6/): Traces import { loadCoreSdkScript } from '@paypal/paypal-js/sdk-v6' against the real @paypal/paypal-js@10.0.1 package from the workspace install. Asserts nft includes node_modules/@paypal/paypal-js/dist/v6/esm/paypal-js.js.
  • Integration test (test/integration/paypal-js-sdk-v6.mjs): Traces, packages, and executes the import to verify loadCoreSdkScript resolves correctly after nft packaging.
  • Adds @paypal/paypal-js@10.0.1 as a devDependency.

Test plan

  • npx jest --testNamePattern="trace paypal-js-sdk-v6" (unit tests from cwd + root)
  • npx jest --testNamePattern="paypal-js-sdk-v6.mjs" (integration trace + execute)
Open in Web Open in Cursor 

Add unit and integration tests for issue #599 where @paypal/paypal-js@10.0.1
exposes ./sdk-v6 with only types + import conditions. The unit fixture mirrors
the package exports map and asserts nft traces dist/v6/esm/paypal-js.js. The
integration test traces, packages, and executes a loadCoreSdkScript import from
the real package to guard against resolving the main entry instead.

Co-authored-by: Steven <styfle@users.noreply.github.com>
@socket-security

socket-security Bot commented Jul 6, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​paypal/​paypal-js@​10.0.110010010099100

View full report

Remove the local mock node_modules from the paypal-js-sdk-v6 unit test and
trace the real @paypal/paypal-js@10.0.1 package from the workspace install.

Co-authored-by: Steven <styfle@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants