Last active
June 26, 2017 23:08
-
-
Save griffinmyers/d675decacdd301114a969ca02f262537 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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