Our unit tests are showing deprecation errors.
As far as I investigated it is related to using the "configureTestSuite" method from 'ng-bullet'. Setting up my test suite as shown below throws the following error:
DEPRECATION: An asynchronous before/it/after function took a done callback but also returned a promise. This is not supported and will stop working in the future. Either remove the done callback (recommended) or change the function to not return a promise. (in suite: ToastComponent)
import { TestBed } from '@angular/core/testing';
import { configureTestSuite } from 'ng-bullet';
import { ToastComponent } from './toast.component';
describe('ToastComponent', () => {
configureTestSuite(() =>
TestBed.configureTestingModule({
declarations: [ToastComponent],
}).compileComponents()
);
it('should create', () => {
console.log('do nothing');
});
});
It would be awesome if somebody could help me out how to get rid of those errors. The tests still pass currently, but still the deprecation is shown as an error. If I remove the configureTestSuite and use the standard beforeEach to set up my TestBed it doesn't throw the error. Not an option, since ng-bullet is speeding up our tests a lot.
I'm using Angular 11 / Karma 6, Jasmine-Core 3.6. Happy to give more input if needed.
As said in the link :
this fix need to be released with new version of zone.js, so please wait for the new release of the zone.js