Closed masteratt closed 3 years ago
Can you please confirm that ng test
is working outside of Wallaby?
Looking at your angular.json
in your diagnostics report, it looks like some paths may be broken (outside of wallaby) which we think is the cause of your problem. From your wallaby diagnostics report:
Error: ENOENT: no such file or directory, open 'C:\Users\[username]\source\repos\CustomerHub\Hub.Web\ClientApp\src\test.ts'\n",
We used your angular.json
configuration as a base for a new project and received other errors when using ng test
:
ERROR in error TS6053: File 'C:/Temp/wallaby-2533/ClientApp/src/src/polyfills.ts' not found.
Because you also have jest
installed as a dependency, because your angular configuration is not valid, Wallaby will then generate an automatic configuration for jest and run your tests using jest, where window
is not available like it is when your tests run in the browser using Angular's default karma
test runner.
Assuming there is something wrong with your angular.json
, once you fix that up, Wallaby should work for you. If your tests are running from the command line, can you please provide us with details of how you're running them and potentially provide a sample project (if that's possible)?
Hi @smcenlly ,
Just to note, npm test
was working fine (let me tell you, using that exclusively really made me appreciate wallaby more!).
For wallaby, and bear with me as I'm new to angular (newer yet to angular unit testing): You have pointed me in the right direction and I removed the 'test' object from angular.json as that object had a 'main' data that was pointing to a file that hasn't existed in the project for some time and there were no other changes to angular.json from when it was working and now :/. So I'm not sure how it was working before but now removing the broken test object from angular.json, I can run both wallaby and npm test 👍
Thanks for looking into the diagnostic and coming back with a clear area for me to look into.
If you have any additions, please feel free to add them but for the sake of keeping the board clean, I'll close the issue as it has been solved.
Hello,
Every time I try to start wallaby I get "window is not defined". I've tried automatic configuration per the link: https://wallabyjs.com/docs/intro/config.html#automatic-configuration to no avail.
Just in case, here's the Wallaby Js (again, do note I also tried automatic config):
And here's the diagnostics report:
Thanks for any guidance