Skip to content

Instantly share code, notes, and snippets.

@unstoppablecarl
Last active December 10, 2015 16:58
Show Gist options
  • Save unstoppablecarl/4464568 to your computer and use it in GitHub Desktop.
Save unstoppablecarl/4464568 to your computer and use it in GitHub Desktop.
describe("Geometry", function() {
beforeEach(function() {
var $canvasContainer = $('<div><canvas width="400", height="400" style="border: 1px solid gray"></canvas></div>').appendTo('body');
jasmine.getEnv().currentSpec.canvasContainer = $canvasContainer;
jasmine.getEnv().currentSpec.renderCanvas = true;
$canvas = $canvasContainer.find('canvas');
g = Geometry;
g.ctx = $canvas[0].getContext('2d');
});
describe("Lines", function() {
it("can check lines are parallel", function() {
});
it("can check lines are coincident", function() {
// remove the canvas instead of appending it to the report output
this.renderCanvas = false;
});
});
});
jasmine.HtmlReporter.SpecView.prototype.appendSummaryToSuiteDiv = function() {
this.summary.className += ' ' + this.status();
if(this.spec.canvasContainer){
if(this.spec.renderCanvas){
this.spec.canvasContainer.appendTo(this.summary);
} else {
this.spec.canvasContainer.remove();
}
}
this.appendToSummary(this.spec, this.summary);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment