I'm trying to create a visual regression framework using mocha, with the visual diff done using backstopjs.
I've got a small first test running, but when I intentionally fail the test, I'd like the mocha framework to acknowledge the failure and report this. As It stands, when running the mocha framework everything goes as I'd expect, but the mocha report still shows as a pass, even though backstopjs is reporting the failure.
Here is my sample test
const assert = require('chai').assert
const backstop = require('backstopjs')
describe('Navigation To Google', () => {
it('and take a screenshot', () => {
backstop('test', {config: './backstop.json'})
.then(() => {
console.log('backstop test')
}).catch((e) => {
//If fails catch error here
console.log(`The error is ${e}`)
})
// I assume I need to handle the assertion here
});
})
My github and the code can be viewed here: https://github.com/Kpizzle/PupperDif