How Mocha does DOM testing without phantoms

It seems I can do DOM tests using Mocha.

I suggested that I need a headless browser like PhantomJS.

What are the benefits of using PhantomJS with Mocha? (I use Yoman.)

+4
source share
1 answer

You don't need a dumb browser to run DOM tests with Mocha. A package like jsdom provides a lot of what is needed to conduct DOM testing without using a browser without a headset or not. For example, we used it for testing code that processes the DOM tree.

Mocha DOM Node.js. - . , DOM, . , , , jQuery Node.js Mocha, npm install jquery, jsdom.

- PhantomJS, . instace jsdom MutationObserver. ( MutationEvents, MutationObserver.) , , MutationObserver, - , , PhantomJS.

+5

All Articles