I have an Angular project run with Electron. My code compiles and works nicely, and now I've come to test it. Before I even start writing tests, all the 'shouldCreate'
tests are failing with the message "TypeError: window.require is not a function"
.
I have seen this post and this post, as well as a few others on the matter, but none of them address what to do if it only fails in tests.
How can I get my tests to succeed, even with my code having things like window.require('fs')
and the like? Again, the code compiles and runs (at least in the dev environment) but my tests fail before I have written them
TIA
EDIT: My code is based off of this github project