Skip to content

Instantly share code, notes, and snippets.

@griffinmyers
Last active June 26, 2017 23:08
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 griffinmyers/d675decacdd301114a969ca02f262537 to your computer and use it in GitHub Desktop.
Save griffinmyers/d675decacdd301114a969ca02f262537 to your computer and use it in GitHub Desktop.
'use strict';
module.exports = config => {
config.set({
basePath: '../../',
frameworks: ['jasmine'],
files: [
'test/visual-diff/break-styles.css',
{ pattern: 'src/**/*.js', included: false, served: true },
{ pattern: 'test/assets/*.{png,jpg}', included: false, served: true },
'test/visual-diff/renderers/helper.js',
'test/visual-diff/renderers/**/*-test.js'
],
autoWatch: false,
client: { useIframe: false },
browsers: ['PhantomJSScreenshot'],
customLaunchers: {
'PhantomJSScreenshot': {
base: 'PhantomJS',
options: {
onPageCreated: function(newPage) {
// Even though this looks like standard javascript that can access
// higher scopes in this file, it actually gets serialized and
// passed as a script to phantomjs. This means some things are
// actually in scope (like a `page` object) and other things are
// not (like anything you might define at the top of this file).
//
newPage.viewportSize = { width: 400, height: 700 };
newPage.onCallback = function(data) {
if (data.type === 'render') {
var path = '/visual-diff/results/' + data.name + '.png';
newPage.render(path, { format: 'png', quality: 100 });
}
}
}
}
}
},
singleRun: true,
reporters: ['spec'],
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment