Make no expectations in HTML Reporter message a warning

- Fixes #1704
This commit is contained in:
Gregg Van Hove
2019-06-12 13:31:25 -07:00
parent 0f4e53d0e6
commit 984018bfdf
3 changed files with 5 additions and 5 deletions

View File

@@ -148,7 +148,7 @@ jasmineRequire.HtmlReporter = function(j$) {
typeof console !== 'undefined' && typeof console !== 'undefined' &&
typeof console.error !== 'undefined' typeof console.error !== 'undefined'
) { ) {
console.error("Spec '" + result.fullName + "' has no expectations."); console.warn("Spec '" + result.fullName + "' has no expectations.");
} }
if (!symbols) { if (!symbols) {

View File

@@ -80,7 +80,7 @@ describe('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 (typeof console === 'undefined') { if (typeof console === 'undefined') {
console = { error: function() {} }; console = { warn: function() {} };
} }
var env = new jasmineUnderTest.Env(), var env = new jasmineUnderTest.Env(),
@@ -99,7 +99,7 @@ describe('HtmlReporter', function() {
} }
}); });
spyOn(console, 'error'); spyOn(console, 'warn');
reporter.initialize(); reporter.initialize();
@@ -109,7 +109,7 @@ describe('HtmlReporter', function() {
passedExpectations: [], passedExpectations: [],
failedExpectations: [] failedExpectations: []
}); });
expect(console.error).toHaveBeenCalledWith( expect(console.warn).toHaveBeenCalledWith(
"Spec 'Some Name' has no expectations." "Spec 'Some Name' has no expectations."
); );
var specEl = container.querySelector('.jasmine-symbol-summary li'); var specEl = container.querySelector('.jasmine-symbol-summary li');

View File

@@ -119,7 +119,7 @@ jasmineRequire.HtmlReporter = function(j$) {
typeof console !== 'undefined' && typeof console !== 'undefined' &&
typeof console.error !== 'undefined' typeof console.error !== 'undefined'
) { ) {
console.error("Spec '" + result.fullName + "' has no expectations."); console.warn("Spec '" + result.fullName + "' has no expectations.");
} }
if (!symbols) { if (!symbols) {