Cannot run tests on WSL
i have moved from VSCode to Webstorm and now my Jest integraton tests are not working. I have set up the configuration but the error seems to be more about not connecting to WSL than about the actual running of a test.
Run Error:
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
If I switch to Terminal I am able to run the tests through CLI, but that is not the answer I am looking for.
Web searches don't seem to be yielding the fix for my issue.
Please sign in to leave a comment.
Jest tests run fine for me in WSL. Do you have a sample project you can share that reproduces the problem? This would help us to investigate it further.
Thank you for the response. Moving forward and ignoring the bash errors I have removed the jest.config reference from the configuration and the error changed to a test level error around my ES6 modules not being recognized. This test error I do recognize as needing to be addressed long ago in my project by adding node options to the test script in package.json.
I have added node script options from the scripts in my package.json into the “temporary” configurations through “Edit Configurations” and got the tests running. Since this worked I then went into the Jest “permanent” template and added those same settings so that going forward I don't have to manually tweak configurations just to get the tests to run.
I am confident my approach is not yet optimized properly but the tests are running as I need them to. The tests currenly are integration tests and not unit tests with mocks (that will come next).
Thanks for the heads up to ignore the bash errors… it allowed me to move on to get the right settings.
This does seem to be an issue with the test runner configurations, not opening a terminal correctly or something. Seems not possible to setup the runner config to not produce the warning… maybe it should be, its a common issue with intellij test running, phantom warnings like this but these warnings are not produced when tests are run in the actual CLI. Suggests intellij quasi CLI is doing it right and the run configs aren't. I tried editing run templates for jest node and npm, it seems to be an issue with the idea runner itself, not the first time I have seen this sort of thing, would be nice if you could fix it.
e.g. The following produces the evil red warnings.
describe("🚨 File Naming Policy", () => {it("enforces schema, seeder, handler, routes, and queries filename conventions", async () => {const baseDir = path.resolve(process.cwd(), "src");const files = await fg(["**/*.ts"], {cwd: baseDir,ignore: ["**/*.test.ts", "**/*.d.ts"],});bash: cannot set terminal process group (-1): Inappropriate ioctl for devicebash: no job control in this shellThe bash warnings don't affect anything and can safely be ignored, they aren't prevent the tests from being run.
Yeah, maybe by your coding standards.
When I see a tool start producing unnecessary warnings due to lazy duplicated coding practices, I stop using it for lack of confidence. could be an IDE, a phone, a car or a nuclear power plant. So all those green arrows next to my code are worthless and I'm running tests at the CLI. The surprise is you expect people to keep paying for IDEA when you ignore us on literally every ticket or support request.
This has been an issue for 15 hears now. All these little warning that persist, that you refuse to fix, they undermine my confidence in your company more than the tool.
This is alway the response I get from intellij. “Please ignore these issues like we do”. You guys got tickets that are 7 years old just sitting there. The surprise is that you'r still tryin to sell that same ticketing system to other devs.
I'm tired of paying for this when this is the support we always get… no matter where or what i contact you about, no matter how many complain, you always without fail push us to do nothing and for us to allow you to ignore it.
Fine, I'll ignore it… I ended my subscription and officially am moving to VS code. Enjoy.