Jest vs PhantomJS: What are the differences?
Some of the features offered by Jest are:
- Familiar Approach: Built on top of the Jasmine test framework, using familiar expect(value).toBe(other) assertions
- Mock by Default: Automatically mocks CommonJS modules returned by require(), making most existing code testable
- Short Feedback Loop: DOM APIs are mocked and tests run in parallel via a small node.js command line utility
On the other hand, PhantomJS provides the following key features:
- Multiplatform, available on major operating systems: Windows, Mac OS X, Linux, and other Unices.
- Pure headless (no X11) on Linux, ideal for continuous integration systems. Also runs on Amazon EC2, Heroku, and Iron.io.
"Open source" is the top reason why over 24 developers like Jest, while over 12 developers mention "Scriptable web browser" as the leading cause for choosing PhantomJS.
Jest and PhantomJS are both open source tools. PhantomJS with 26.9K GitHub stars and 5.7K forks on GitHub appears to be more popular than Jest with 26.1K GitHub stars and 3.53K GitHub forks.
Repro, Glympse, and Ubiqua are some of the popular companies that use Jest, whereas PhantomJS is used by Key Location, Ghost Inspector, and Tailor Brands. Jest has a broader approval, being mentioned in 263 company stacks & 150 developers stacks; compared to PhantomJS, which is listed in 78 company stacks and 47 developer stacks.
What is Jest?
What is PhantomJS?
Need advice about which tool to choose?Ask the StackShare community!
Sign up to add, upvote and see more prosMake informed product decisions
What are the cons of using Jest?
What are the cons of using PhantomJS?
Sign up to add, upvote and see more consMake informed product decisions
Sign up to get full access to all the companiesMake informed product decisions
Sign up to get full access to all the tool integrationsMake informed product decisions
I'm using Jest for 3 months in a Vue JS project . I need to use a lot of custom search of related topics in jest docs because it's not clear. The examples are very poor too.
Jest is my unit-testing tool of choice.
Almost all unit testing suites (Mocha, Jasmine, etc.) are more or less the same.
The main advantage I guess, is that it integrates pretty well with React and Enzyme.
We run PhantomJS as part of the CircleCI testing, comparing against other branches to ensure changes are limited to their intended scope.
Headless browsing, headless chrome is good too, this is not supported anymore.