Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

failing spec for multiple inits

  • Loading branch information...
commit 67505592112cf6f122410fad3f40d152ccfaf7e0 1 parent 00c8e37
Luke van der Hoeven plukevdh authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 spec/html/HtmlReporterSpec.js
17 spec/html/HtmlReporterSpec.js
View
@@ -32,6 +32,23 @@ describe("New HtmlReporter", function() {
expect(versionText).toEqual(j$.version);
});
+ it("builds a single reporter even if initialized multiple times", function() {
+ var env = new j$.Env(),
+ container = document.createElement("div"),
+ getContainer = function() { return container; },
+ reporter = new j$.HtmlReporter({
+ env: env,
+ getContainer: getContainer,
+ createElement: function() { return document.createElement.apply(document, arguments); },
+ createTextNode: function() { return document.createTextNode.apply(document, arguments); }
+ });
+ reporter.initialize();
+ reporter.initialize();
+ reporter.initialize();
+
+ expect(container.querySelectorAll("div.html-reporter").length).toEqual(1);
+ });
+
it("starts the timer when jasmine begins", function() {
var env = new jasmine.Env(),
startTimerSpy = jasmine.createSpy("start-timer-spy"),
Please sign in to comment.
Something went wrong with that request. Please try again.