Validation is failing due to this error . I have created new LWC component, it defaults created test.js file .I have removed and have only my component html,js and meta.xml file .I created PR in GitHub and validation fails . Can anyone please support here
1 Answer
The Jest Unit-Tests should not be deployed to the org.
You need to add a .forceignore
file to your project.
Use this file as a template: https://github.com/trailheadapps/visualforce-to-lwc/blob/main/.forceignore
-
I get the above validation error in the jest test file. I'm not deploying to the org. I can see that sfdx Deploy is not deploying the just test js file. The test passes. It just fails validation in the __tests__\...test.js file. Aug 18 at 14:08
-
Update: I deleted the import line, but that caused a massive runtime error. Then I added it back (<ctrl>z). The runtime error and the validation error are now gone. Maybe it takes a while for all the configuration to get consumed and active. Also, my .forceignore file already had the test folder ignored. The behind-the-scenes magic must have done that. Aug 18 at 15:07
createElement
is used in jest test files