test: add regression coverage for @paypal/paypal-js sdk-v6 subpath (issue #599)#600
Draft
styfle wants to merge 2 commits into
Draft
test: add regression coverage for @paypal/paypal-js sdk-v6 subpath (issue #599)#600styfle wants to merge 2 commits into
styfle wants to merge 2 commits into
Conversation
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>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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>
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.
Summary
Adds regression test coverage for #599, where
@paypal/paypal-js@10.0.1exposes the./sdk-v6subpath with only"types"+"import"conditions (no"default"or"require").The reported failure is a runtime
SyntaxErrorwhen Node resolves@paypal/paypal-js/sdk-v6to the main entry (dist/esm/paypal-js.js) instead of the v6 entry (dist/v6/esm/paypal-js.js), causing the named exportloadCoreSdkScriptto be missing.Changes
test/unit/paypal-js-sdk-v6/): Tracesimport { loadCoreSdkScript } from '@paypal/paypal-js/sdk-v6'against the real@paypal/paypal-js@10.0.1package from the workspace install. Asserts nft includesnode_modules/@paypal/paypal-js/dist/v6/esm/paypal-js.js.test/integration/paypal-js-sdk-v6.mjs): Traces, packages, and executes the import to verifyloadCoreSdkScriptresolves correctly after nft packaging.@paypal/paypal-js@10.0.1as 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)