Skip to content

Commit 6cf7d91

Browse files
committed
test(*): returning run to two shards
1 parent fc9b8d1 commit 6cf7d91

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

projects/igniteui-angular/karma.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module.exports = function (config) {
2020
'@angular-devkit/build-angular/plugins/karma'
2121
],
2222
parallelOptions: {
23-
executors: 4,
23+
executors: 2,
2424
shardStrategy: 'round-robin'
2525
},
2626
client: {
@@ -45,7 +45,7 @@ module.exports = function (config) {
4545
logLevel: config.LOG_INFO,
4646
autoWatch: true,
4747
browsers: ['ChromeHeadlessNoSandbox'],
48-
browserDisconnectTimeout: 6000,
48+
browserDisconnectTimeout: 4000,
4949
customLaunchers: {
5050
ChromeHeadlessNoSandbox: {
5151
base: 'ChromeHeadless',

projects/igniteui-angular/src/lib/test-utils/configure-suite.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ import { resizeObserverIgnoreError } from './helper-utils.spec';
99
*/
1010

1111
export const configureTestSuite = (configureAction?: () => TestBed) => {
12-
13-
const testBed: any = getTestBed();
12+
const testBed = getTestBed();
1413
const originReset = testBed.resetTestingModule;
1514

1615
const clearStyles = () => {
@@ -21,10 +20,12 @@ export const configureTestSuite = (configureAction?: () => TestBed) => {
2120
document.querySelectorAll('svg').forEach(tag => tag.remove());
2221
};
2322

23+
let _resizerSub: jasmine.Spy<OnErrorEventHandlerNonNull>;
24+
2425
beforeAll(() => {
25-
testBed.resetTestingModule();
26-
testBed.resetTestingModule = () => TestBed;
27-
resizeObserverIgnoreError();
26+
// testBed.resetTestingModule();
27+
testBed.resetTestingModule = () => testBed;
28+
_resizerSub = resizeObserverIgnoreError();
2829
});
2930

3031
if (configureAction) {
@@ -36,20 +37,21 @@ export const configureTestSuite = (configureAction?: () => TestBed) => {
3637
afterEach(() => {
3738
clearStyles();
3839
clearSVGContainer();
39-
testBed._activeFixtures.forEach((fixture: ComponentFixture<any>) => {
40+
(testBed as any)._activeFixtures.forEach((fixture: ComponentFixture<any>) => {
4041
const element = fixture.debugElement.nativeElement as HTMLElement;
41-
fixture.destroy();
42+
// fixture.destroy();
4243
// If the fixture element ID changes, then it's not properly disposed
4344
element?.remove();
4445
});
4546
// reset ViewEngine TestBed
46-
testBed._instantiated = false;
47+
(testBed as any)._instantiated = false;
4748
// reset Ivy TestBed
48-
testBed._testModuleRef = null;
49+
(testBed as any)._testModuleRef = null;
4950
});
5051

5152
afterAll(() => {
5253
testBed.resetTestingModule = originReset;
5354
testBed.resetTestingModule();
55+
_resizerSub = null;
5456
});
5557
};

0 commit comments

Comments
 (0)