mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-10-08 14:51:32 +00:00
[ADF-2569] fix reload app.config.json (#3124)
* fix reload app.config.json * improve style mobile fix test * test karma setup update * fix core providers test * remove unused providers * use mock api in service test * skip test in the wrong place * remove comma * remove fdescribe
This commit is contained in:
committed by
Denys Vuika
parent
21b8cd30ce
commit
9e2969b955
@@ -24,11 +24,11 @@ const AppConfigService = require('@alfresco/adf-core').AppConfigService;
|
||||
const AppConfigServiceMock = require('@alfresco/adf-core').AppConfigServiceMock;
|
||||
const TranslationService = require('@alfresco/adf-core').TranslationService;
|
||||
const TranslationMock = require('@alfresco/adf-core').TranslationMock;
|
||||
const AlfrescoApiServiceMock = require('@alfresco/adf-core').AlfrescoApiServiceMock;
|
||||
const AlfrescoApiService = require('@alfresco/adf-core').AlfrescoApiService;
|
||||
|
||||
TestBed.initTestEnvironment(browser.BrowserDynamicTestingModule, browser.platformBrowserDynamicTesting());
|
||||
|
||||
patchTestBedToDestroyFixturesAfterEveryTest(TestBed);
|
||||
|
||||
beforeEach(() => {
|
||||
TestBed.configureTestingModule({
|
||||
imports: [
|
||||
@@ -36,6 +36,7 @@ beforeEach(() => {
|
||||
CoreModule.forRoot()
|
||||
],
|
||||
providers: [
|
||||
{provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock},
|
||||
{provide: AppConfigService, useClass: AppConfigServiceMock},
|
||||
{provide: TranslationService, useClass: TranslationMock}
|
||||
]
|
||||
@@ -46,24 +47,3 @@ afterEach(() => {
|
||||
TestBed.resetTestingModule();
|
||||
});
|
||||
|
||||
function patchTestBedToDestroyFixturesAfterEveryTest(testBed) {
|
||||
// Original resetTestingModule function of the TestBed.
|
||||
var _resetTestingModule = testBed.resetTestingModule;
|
||||
|
||||
// Monkey-patch the resetTestingModule to destroy fixtures outside of a try/catch block.
|
||||
// With https://github.com/angular/angular/commit/2c5a67134198a090a24f6671dcdb7b102fea6eba
|
||||
// errors when destroying components are no longer causing Jasmine to fail.
|
||||
testBed.resetTestingModule = function() {
|
||||
try {
|
||||
if(this._activeFixtures) {
|
||||
this._activeFixtures.forEach(function (fixture) {
|
||||
fixture.destroy();
|
||||
});
|
||||
}
|
||||
} finally {
|
||||
this._activeFixtures = [];
|
||||
// Regardless of errors or not, run the original reset testing module function.
|
||||
_resetTestingModule.call(this);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
Reference in New Issue
Block a user