Skip to content

feat(config): allow @lwc/state and ignoreTransform of it#486

Merged
jmsjtu merged 2 commits intosalesforce:masterfrom
jodarove:jodarove/lwc-state
Jan 15, 2026
Merged

feat(config): allow @lwc/state and ignoreTransform of it#486
jmsjtu merged 2 commits intosalesforce:masterfrom
jodarove:jodarove/lwc-state

Conversation

@jodarove
Copy link
Copy Markdown
Contributor

Detail

As a component developer i would like to test a state managers and/or components using it.

This PR adds @lwc/state to sfdx-lwc-jest and adds it to the transformIgnorePatterns section of the configuration, as @lwc/state is an esmodule

Comment thread src/config.js Outdated
testPathIgnorePatterns: ['<rootDir>/node_modules/', '<rootDir>/test/specs/'],
transformIgnorePatterns: [
'/node_modules/(?!(.*@salesforce/sfdx-lwc-jest/src/lightning-stubs)/)',
'/node_modules/(?!(@lwc/state)|(.*@salesforce/sfdx-lwc-jest/src/lightning-stubs)/)',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@jodarove will @lwc/state ever be nested inside another NPM package?

Looks like with .*@salesforce/sfdx-lwc-jest/... it can be nested in a module like:

node_modules/some-nested-path/@salesforce/sfdx-lwc-jest/src/lightning-stubs/...

Should we be looking w/ the same pattern for @lwc/state?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

nice catch! i don't know if it can ever be nested, but it is better to be safe than sorry!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jmsjtu updated in c37cab5

@jmsjtu jmsjtu merged commit f69a87d into salesforce:master Jan 15, 2026
2 checks passed
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.

4 participants