You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After cloning the repo, VSCode's Test Explorer is unable to run the tests in the app.
The tests work when running npm run test:unit in terminal.
Fixed by running npm install jest-environment-jsdom --save-dev.
I can submit a PR with extra dependency if you agree with the approach.
Salesforce Org Type
Scratch Org
Steps To Reproduce
Clone the repo
Open it with VSCode
Run npm install
Run npm run test:unit and observe that the tests pass
Open VSTest Explorer click on "Run all" icon
Current Behavior
All tests fail
Expected Behavior
All tests pass
Relevant Log Output
● Test suite failed to run
TypeError: Cannot read properties of undefined (reading 'html')
at new JSDOMEnvironment (node_modules/jest-environment-jsdom/build/index.js:72:44)
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
This issue occurs because Jest v28 stopped bundling the extra jest-environment-jsdom dependency. This is required for LWC, and has been pre-packaged by sfdx-lwc-jest.
I'll update sfdx-lwc-jest to get it fixed.
Summary
After cloning the repo, VSCode's Test Explorer is unable to run the tests in the app.
The tests work when running
npm run test:unit
in terminal.Fixed by running
npm install jest-environment-jsdom --save-dev
.I can submit a PR with extra dependency if you agree with the approach.
Salesforce Org Type
Scratch Org
Steps To Reproduce
npm install
npm run test:unit
and observe that the tests passCurrent Behavior
All tests fail
Expected Behavior
All tests pass
Relevant Log Output
Code of Conduct
The text was updated successfully, but these errors were encountered: