4 ms·
This doesn't do browser testing (like Karma), it's just an alternative to mocha, right?
by Nitramp 10y ago
This doesn't do browser testing (like Karma), it's just an alternative to mocha, right?
- b34r 10y agoNot out of the box, but the environment setup is easily configurable. I've been using a Protractor for my E2E tests since it also uses Jasmine... does the trick until there is more first-party support.
- BJanecke 10y agoIt comes with jsDom baked into it for browser behaviour. Using a full headless browser to test with is not ideal, however I trust that you have a good reason to want that. If that is a requirement for you, you can tie jest up to karma :), but I beseech you to have a very good reason to test against a headless browser first :)
- Nitramp 10y agoDepends on what you want to test, I guess. If you want to test UI widget behaviour (not just business logic), then jsDom probably isn't the right tool and you need a browser. E.g. if you need CSS measurements or more tricky DOM behaviour. It's not entirely clear to me why you'd want a headless browser though. Once you're already running a browser, you might as well run a full one, and also get the debugging capabilities.