Last active
December 10, 2015 16:58
-
-
Save unstoppablecarl/4464568 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
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; | |
}); | |
}); | |
}); |
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
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