Answer the question
In order to leave comments, you need to log in
How to use mocha+chai in phantomJs?
There are functional tests for the site. Currently using zombieJs+mocha. There are always some problems with zombies. We decided to try phantomJs.
I liked phantomJs myself. But it's not entirely clear how to add mocha in the simplest demo test.
var page = require('webpage').create();
page.open('http://google.com', function() {
var title = page.evaluate(function() {
return document.title;
});
// Далее хочется что-то вроде такого
it('check title', function(){
expect(title).to.equal('Google');
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question