Truffler's API changes between major versions. This is a guide to help you make the switch when this happens.
The test function passed into Truffler now accepts additional arguments – the defaulted options are now passed into it. This allows option overrides outside of Truffler itself.
var test = truffler(function(browser, page, done) {
// the test function to run in PhantomJS
done();
});
becomes:
var test = truffler(function(browser, page, options, done) {
// the test function to run in PhantomJS
done();
});
Node.js 0.10 and 0.12 are no longer supported. We'll be using newer ES6 features in upcoming releases which will not work in this older Node.js version.
Version 2.0 brings a few major changes:
The Truffler API has been overhauled completely. It would be best to refer to the usage guide in the README as your code will need refactoring.
The phantom.port
option no longer has a default. If a port is not specified, then Truffler will bind to an available port. This allows for easier running of tests in parallel, as PhantomJS instances will no longer conflict with eachother.
Truffler 2.0 has switched from using sgentle/phantomjs-node to baudehlo/node-phantom-simple.
The new bridge is much simpler with fewer dependencies, and should allow us to support later versions of Node.js more easily.
This introduces some slight incompatibilities, See the node-phantom-simple usage guide for more information.
Node.js 0.10 is no longer officially supported. We'll be running tests against it still, but these are marked as "allowed to fail". If you're absolutely reliant on Node.js 0.10, check the latest build to verify that it's still working.