Skip to content

Instantly share code, notes, and snippets.

@griffinmyers
Created June 26, 2017 23:06
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/56a505fba5dca33feadd16a6f766b0e3 to your computer and use it in GitHub Desktop.
Save griffinmyers/56a505fba5dca33feadd16a6f766b0e3 to your computer and use it in GitHub Desktop.
// `name`: The image filename
// `done`: A function provided by jasmine to invoke when we're finished
// rendering
window.renderScreen = function renderScreen(name, done) {
setTimeout(function() {
window.top.callPhantom({ type: 'render', name: name });
done();
}, 500);
}
beforeEach(function() {
this.container = document.createElement('div');
this.container.style.width = '100%';
this.container.style.border = '1px solid gray';
this.container.style.padding = '10px';
this.container.style.backgroundColor = 'white';
this.container.style.boxSizing = 'border-box';
document.body.appendChild(this.container);
});
afterEach(function() {
this.container.remove();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment