Skip to content

Instantly share code, notes, and snippets.

@joelgriffith
Created July 19, 2017 22:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joelgriffith/0310b48962aa2dd297e606495658a6a5 to your computer and use it in GitHub Desktop.
Save joelgriffith/0310b48962aa2dd297e606495658a6a5 to your computer and use it in GitHub Desktop.
Visual Regression Testing in Navali
const { Chrome } = require('navalia');
const { toMatchImageSnapshot } = require('jest-image-snapshot');
expect.extend({ toMatchImageSnapshot });
describe('Visual Regressions', () => {
let chrome = null;
beforeEach(() => {
chrome = new Chrome();
});
afterEach(() => {
chrome.done();
});
it('should NEVER happen', () => {
return chrome.goto('http://www.my-webpage.com')
.then(() => chrome.screenshot())
.then((image) => expect(image).toMatchImageSnapshot());
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment