diff --git a/src/app/app.component.test.ts b/src/app/app.component.test.ts index 1a8d32c16..e815b64bd 100644 --- a/src/app/app.component.test.ts +++ b/src/app/app.component.test.ts @@ -22,6 +22,7 @@ import { Network, Platform, NgZone } from '@singletons'; import { mockSingleton, renderComponent } from '@/testing/utils'; import { CoreNavigator, CoreNavigatorService } from '@services/navigator'; +import { CoreSitePlugins } from '@features/siteplugins/services/siteplugins'; describe('AppComponent', () => { @@ -33,6 +34,7 @@ describe('AppComponent', () => { mockSingleton(Network, { onChange: () => new Observable() }); mockSingleton(Platform, { ready: () => Promise.resolve(), resume: new Subject() }); mockSingleton(NgZone, { run: jest.fn() }); + mockSingleton(CoreSitePlugins, { hasSitePluginsLoaded: false }); navigator = mockSingleton(CoreNavigator, ['navigate']); langProvider = mockSingleton(CoreLang, ['clearCustomStrings']); diff --git a/src/testing/setup.ts b/src/testing/setup.ts index 9972e2e8e..6bffcfaca 100644 --- a/src/testing/setup.ts +++ b/src/testing/setup.ts @@ -21,6 +21,12 @@ console.debug = () => { // Silence. }; +// eslint-disable-next-line no-console, jest/no-jasmine-globals, @typescript-eslint/no-explicit-any +console.error = (...args: any[]) => fail(args.map(a => a.toString()).join('')); + +// eslint-disable-next-line jest/no-jasmine-globals +process.on('unhandledRejection', error => fail(error)); + // Override the method to create singleton method proxies in order to facilitate setting up // test expectations about method calls. setCreateSingletonMethodProxy(