Fixes console check for IE8
- Was causing IE8 to hang for some reason - Also reverts previous commit, not that issue was resolved [#79533268][fixes #80356450]
This commit is contained in:
@@ -101,7 +101,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
|||||||
|
|
||||||
var failures = [];
|
var failures = [];
|
||||||
this.specDone = function(result) {
|
this.specDone = function(result) {
|
||||||
if(noExpectations(result) && console && console.error) {
|
if(noExpectations(result) && typeof console !== 'undefined' && typeof console.error !== 'undefined') {
|
||||||
console.error('Spec \'' + result.fullName + '\' has no expectations.');
|
console.error('Spec \'' + result.fullName + '\' has no expectations.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -200,6 +200,10 @@ describe("JsApiReporter", function() {
|
|||||||
reporter.suiteDone(suiteResult2);
|
reporter.suiteDone(suiteResult2);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should not include suite starts', function(){
|
||||||
|
expect(reporter.suiteResults(0,3).length).toEqual(2);
|
||||||
|
});
|
||||||
|
|
||||||
it("should return a slice of results", function() {
|
it("should return a slice of results", function() {
|
||||||
expect(reporter.suiteResults(0, 1)).toEqual([suiteResult1]);
|
expect(reporter.suiteResults(0, 1)).toEqual([suiteResult1]);
|
||||||
expect(reporter.suiteResults(1, 1)).toEqual([suiteResult2]);
|
expect(reporter.suiteResults(1, 1)).toEqual([suiteResult2]);
|
||||||
|
|||||||
@@ -65,8 +65,8 @@ describe("New HtmlReporter", function() {
|
|||||||
|
|
||||||
describe("when a spec is done", function() {
|
describe("when a spec is done", function() {
|
||||||
it("logs errors to the console and prints a special symbol if it is an empty spec", function() {
|
it("logs errors to the console and prints a special symbol if it is an empty spec", function() {
|
||||||
if (!window.console) {
|
if (typeof console === "undefined") {
|
||||||
window.console = { error: function(){} };
|
console = { error: function(){} };
|
||||||
}
|
}
|
||||||
|
|
||||||
var env = new j$.Env(),
|
var env = new j$.Env(),
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ jasmineRequire.HtmlReporter = function(j$) {
|
|||||||
|
|
||||||
var failures = [];
|
var failures = [];
|
||||||
this.specDone = function(result) {
|
this.specDone = function(result) {
|
||||||
if(noExpectations(result) && console && console.error) {
|
if(noExpectations(result) && typeof console !== 'undefined' && typeof console.error !== 'undefined') {
|
||||||
console.error('Spec \'' + result.fullName + '\' has no expectations.');
|
console.error('Spec \'' + result.fullName + '\' has no expectations.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user