Fixes https://github.com/pivotal/jasmine-gem/issues/65 and https://www.pivotaltracker.com/story/show/24902023
This commit is contained in:
@@ -44,8 +44,23 @@ describe("HtmlReporter", function() {
|
|||||||
expect(htmlReporter.specFilter(fakeSpec("not run this"))).toBeFalsy();
|
expect(htmlReporter.specFilter(fakeSpec("not run this"))).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Matcher reporting', function () {
|
describe("running without any specs", function() {
|
||||||
var getResultMessageDiv = function (body) {
|
var runner;
|
||||||
|
beforeEach(function() {
|
||||||
|
runner = env.currentRunner();
|
||||||
|
env.addReporter(htmlReporter);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should not error", function() {
|
||||||
|
var exec = function() {
|
||||||
|
runner.execute();
|
||||||
|
};
|
||||||
|
expect(exec).not.toThrow();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe('Matcher reporting', function() {
|
||||||
|
var getResultMessageDiv = function(body) {
|
||||||
var divs = body.getElementsByTagName("div");
|
var divs = body.getElementsByTagName("div");
|
||||||
for (var i = 0; i < divs.length; i++) {
|
for (var i = 0; i < divs.length; i++) {
|
||||||
if (divs[i].className.match(/resultMessage/)) {
|
if (divs[i].className.match(/resultMessage/)) {
|
||||||
@@ -55,7 +70,7 @@ describe("HtmlReporter", function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
var runner, spec, fakeTimer;
|
var runner, spec, fakeTimer;
|
||||||
beforeEach(function () {
|
beforeEach(function() {
|
||||||
fakeTimer = new jasmine.FakeTimer();
|
fakeTimer = new jasmine.FakeTimer();
|
||||||
env.setTimeout = fakeTimer.setTimeout;
|
env.setTimeout = fakeTimer.setTimeout;
|
||||||
env.clearTimeout = fakeTimer.clearTimeout;
|
env.clearTimeout = fakeTimer.clearTimeout;
|
||||||
@@ -70,9 +85,9 @@ describe("HtmlReporter", function() {
|
|||||||
env.addReporter(htmlReporter);
|
env.addReporter(htmlReporter);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('toContain', function () {
|
describe('toContain', function() {
|
||||||
it('should show actual and expected', function () {
|
it('should show actual and expected', function() {
|
||||||
spec.runs(function () {
|
spec.runs(function() {
|
||||||
this.expect('foo').toContain('bar');
|
this.expect('foo').toContain('bar');
|
||||||
});
|
});
|
||||||
runner.execute();
|
runner.execute();
|
||||||
@@ -85,7 +100,7 @@ describe("HtmlReporter", function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("failure messages (integration)", function () {
|
describe("failure messages (integration)", function() {
|
||||||
var spec, results, expectationResult;
|
var spec, results, expectationResult;
|
||||||
|
|
||||||
it("should add the failure message to the DOM (non-toEquals matchers)", function() {
|
it("should add the failure message to the DOM (non-toEquals matchers)", function() {
|
||||||
@@ -168,7 +183,7 @@ describe("HtmlReporter", function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('#reportSpecStarting', function() {
|
describe('#reportSpecStarting', function() {
|
||||||
beforeEach(function () {
|
beforeEach(function() {
|
||||||
env.describe("suite 1", function() {
|
env.describe("suite 1", function() {
|
||||||
env.it("spec 1", function() {
|
env.it("spec 1", function() {
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ jasmine.HtmlReporter = function(_doc) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
self.reportRunnerResults = function(runner) {
|
self.reportRunnerResults = function(runner) {
|
||||||
reporterView.complete();
|
reporterView && reporterView.complete();
|
||||||
};
|
};
|
||||||
|
|
||||||
self.reportSuiteResults = function(suite) {
|
self.reportSuiteResults = function(suite) {
|
||||||
|
|||||||
Reference in New Issue
Block a user