Revert "Deprecate the suppressLoadErrors option"
jasmine-npm still needs this to enable the default behavior of crashing
with a stack trace on load errors.
This reverts commit 99e350ac85.
This commit is contained in:
@@ -1654,14 +1654,6 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
* @return {Promise<JasmineDoneInfo>}
|
* @return {Promise<JasmineDoneInfo>}
|
||||||
*/
|
*/
|
||||||
this.execute = async function(runablesToRun) {
|
this.execute = async function(runablesToRun) {
|
||||||
if (options.suppressLoadErrors) {
|
|
||||||
this.deprecated(
|
|
||||||
'The suppressLoadErrors option is deprecated and will be removed ' +
|
|
||||||
'in a future release.',
|
|
||||||
{ ignoreRunnable: true, omitStackTrace: true }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
installGlobalErrors();
|
installGlobalErrors();
|
||||||
|
|
||||||
if (parallelLoadingState) {
|
if (parallelLoadingState) {
|
||||||
|
|||||||
@@ -634,10 +634,6 @@ describe('Env', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('when constructed with suppressLoadErrors: true', function() {
|
describe('when constructed with suppressLoadErrors: true', function() {
|
||||||
beforeEach(function() {
|
|
||||||
spyOn(console, 'error'); // prevent deprecation from being logged
|
|
||||||
});
|
|
||||||
|
|
||||||
it('does not install a global error handler until execute is called', function() {
|
it('does not install a global error handler until execute is called', function() {
|
||||||
const globalErrors = jasmine.createSpyObj('globalErrors', [
|
const globalErrors = jasmine.createSpyObj('globalErrors', [
|
||||||
'install',
|
'install',
|
||||||
|
|||||||
@@ -2905,10 +2905,6 @@ describe('Env integration', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('If suppressLoadErrors: true was passed', function() {
|
describe('If suppressLoadErrors: true was passed', function() {
|
||||||
beforeEach(function() {
|
|
||||||
spyOn(console, 'error'); // prevent deprecation from being logged
|
|
||||||
});
|
|
||||||
|
|
||||||
it('does not install a global error handler during loading', async function() {
|
it('does not install a global error handler during loading', async function() {
|
||||||
const originalOnerror = jasmine.createSpy('original onerror');
|
const originalOnerror = jasmine.createSpy('original onerror');
|
||||||
const global = {
|
const global = {
|
||||||
@@ -2947,24 +2943,6 @@ describe('Env integration', function() {
|
|||||||
expect(e.failedExpectations).toEqual([]);
|
expect(e.failedExpectations).toEqual([]);
|
||||||
expect(originalOnerror).toHaveBeenCalledWith('Uncaught Error: ENOCHEESE');
|
expect(originalOnerror).toHaveBeenCalledWith('Uncaught Error: ENOCHEESE');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('emits a deprecation warning', async function() {
|
|
||||||
env.cleanup_();
|
|
||||||
env = new jasmineUnderTest.Env({ suppressLoadErrors: true });
|
|
||||||
const reporter = jasmine.createSpyObj('reporter', [
|
|
||||||
'jasmineDone',
|
|
||||||
'suiteDone',
|
|
||||||
'specDone'
|
|
||||||
]);
|
|
||||||
|
|
||||||
env.addReporter(reporter);
|
|
||||||
await env.execute();
|
|
||||||
|
|
||||||
const e = reporter.jasmineDone.calls.argsFor(0)[0];
|
|
||||||
expect(e.deprecationWarnings[0].message).toMatch(
|
|
||||||
/^The suppressLoadErrors option is deprecated and will be removed in a future release/
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Overall status in the jasmineDone event', function() {
|
describe('Overall status in the jasmineDone event', function() {
|
||||||
|
|||||||
@@ -518,14 +518,6 @@ getJasmineRequireObj().Env = function(j$) {
|
|||||||
* @return {Promise<JasmineDoneInfo>}
|
* @return {Promise<JasmineDoneInfo>}
|
||||||
*/
|
*/
|
||||||
this.execute = async function(runablesToRun) {
|
this.execute = async function(runablesToRun) {
|
||||||
if (options.suppressLoadErrors) {
|
|
||||||
this.deprecated(
|
|
||||||
'The suppressLoadErrors option is deprecated and will be removed ' +
|
|
||||||
'in a future release.',
|
|
||||||
{ ignoreRunnable: true, omitStackTrace: true }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
installGlobalErrors();
|
installGlobalErrors();
|
||||||
|
|
||||||
if (parallelLoadingState) {
|
if (parallelLoadingState) {
|
||||||
|
|||||||
Reference in New Issue
Block a user