4 ms·
The main reason I’ve ended up migrating Jest projects to mocha is for backend integration tests using the db. Jest is clearly built for the frontend first. It n
by ruffrey 3y ago
The main reason I’ve ended up migrating Jest projects to mocha is for backend integration tests using the db. Jest is clearly built for the frontend first. It needs workarounds to run sequentially. That’s important for setting up and tearing down a certain specific backend app state for a test. startup scripts (db teardown and migrations maybe) are tough to configure with typescript, or even at all. generally typescript is tough to configure at all with Jest. Nested tests do not always work predictably with setup and teardown. The mocking and spies aren’t as good as Sinon or nock. expect doesn’t allow a fallback error message like plain assert (just a pattern, no lock in to jest there). running jest with a debugger requires annoying re-configuration per specific test in Jetbrains because Jest has its own VM, doesn’t pick up subtle config, and jest doesn’t often run your code in the same way as plain nodejs due to the vm.