Need advice about which tool to choose?Ask the StackShare community!
Jasmine vs PhantomJS: What are the differences?
What is Jasmine? DOM-less simple JavaScript testing framework. Jasmine is a Behavior Driven Development testing framework for JavaScript. It does not rely on browsers, DOM, or any JavaScript framework. Thus it's suited for websites, Node.js projects, or anywhere that JavaScript can run.
What is PhantomJS? Scriptable Headless WebKit. PhantomJS (www.phantomjs.org) is a headless WebKit scriptable with JavaScript. It is used by hundreds of developers and dozens of organizations for web-related development workflow.
Jasmine can be classified as a tool in the "Javascript Testing Framework" category, while PhantomJS is grouped under "Headless Browsers".
"Can also be used for tdd " is the primary reason why developers consider Jasmine over the competitors, whereas "Scriptable web browser" was stated as the key factor in picking PhantomJS.
Jasmine and PhantomJS are both open source tools. It seems that PhantomJS with 26.9K GitHub stars and 5.7K forks on GitHub has more adoption than Jasmine with 14.4K GitHub stars and 2.12K GitHub forks.
Typeform, Coderus, and Zenefits are some of the popular companies that use Jasmine, whereas PhantomJS is used by Key Location, Indiegogo, and Tailor Brands. Jasmine has a broader approval, being mentioned in 143 company stacks & 75 developers stacks; compared to PhantomJS, which is listed in 77 company stacks and 47 developer stacks.
I am using Node 12 for server scripting and have a function to generate PDF and send it to a browser. Currently, we are using PhantomJS to generate a PDF. Some web post shows that we can achieve PDF generation using Puppeteer. I was a bit confused. Should we move to puppeteerJS? Which one is better with NodeJS for generating PDF?
You better go with puppeteer. It is basically chrome automation tool, written in nodejs. So what you get is PDF, generated by chrome itself. I guess there is hardly better PDF generation tool for the web. Phantomjs is already more or less outdated as technology. It uses some old webkit port that's quite behind in terms of standards and features. It can be replaced with puppeteer for every single task.
I suggest puppeteer to go for. It is simple and easy to set up. Only limitaiton is it can be used only for chrome browser and currently they are looking into expanding into FF. The next thing is Playwright which is just a scale up of Puppeteer. It supports cross browsers.
We use Mocha for our FDA verification testing. It's integrated into Meteor, our upstream web application framework. We like how battle tested it is, its' syntax, its' options of reporters, and countless other features. Most everybody can agree on mocha, and that gets us half-way through our FDA verification and validation (V&V) testing strategy.
Pros of Jasmine
- Can also be used for tdd64
- Open source49
- Originally from RSpec18
- Great community15
- No dependencies, not even DOM14
- Easy to setup10
- Simple8
- Created by Pivotal-Labs3
- Works with KarmaJs2
- Jasmine is faster than selenium in angular application1
- SpyOn to fake calls1
- Async and promises are easy calls with "done"1
Pros of PhantomJS
- Scriptable web browser13
- Depends on QT3
- No ECMAScript 62
Sign up to add or upvote prosMake informed product decisions
Cons of Jasmine
- Unfriendly error logs2