Skip to content

Commit

Permalink
[YUNIKORN-2081] Update karma in web UI test (#151)
Browse files Browse the repository at this point in the history
Update karma-jasmine to version 5.1.0.
Remove the dependency on ng-bullet since it is causing an error.
The purpose of ng-bullet is to reduce the overall test execution time.
However, after removing ng-bullet, no significant increase in test time
was seen.

Closes: #151

Signed-off-by: Wilfred Spiegelenburg <[email protected]>
  • Loading branch information
brandboat authored and wilfred-s committed Jan 25, 2024
1 parent 69e0eb8 commit 221662f
Show file tree
Hide file tree
Showing 17 changed files with 40 additions and 68 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,11 @@
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.1",
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-jasmine": "~4.0.2",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"karma-spec-reporter": "^0.0.36",
"karma-super-dots-reporter": "^0.2.0",
"lint-staged": "^15.0.2",
"ng-bullet": "^1.0.3",
"ng-mocks": "^14.11.0",
"prettier": "^3.0.3",
"puppeteer": "^21.3.8",
Expand Down
5 changes: 2 additions & 3 deletions src/app/app.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import { TestBed, ComponentFixture } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { NgxSpinnerModule } from 'ngx-spinner';
import { configureTestSuite } from 'ng-bullet';
import { MatMenuModule } from '@angular/material/menu';
import { MatTooltipModule } from '@angular/material/tooltip';
import { HAMMER_LOADER } from '@angular/platform-browser';
Expand All @@ -32,15 +31,15 @@ describe('AppComponent', () => {
let component: AppComponent;
let fixture: ComponentFixture<AppComponent>;

configureTestSuite(() => {
beforeAll(() => {
TestBed.configureTestingModule({
declarations: [AppComponent],
imports: [RouterTestingModule, NgxSpinnerModule, MatMenuModule, MatTooltipModule],
providers: [
{ provide: EventBusService, useValue: MockEventBusService },
{ provide: HAMMER_LOADER, useValue: () => new Promise(() => {}) },
],
});
}).compileComponents();
});

beforeEach(() => {
Expand Down
5 changes: 2 additions & 3 deletions src/app/components/app-history/app-history.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {MatCardModule} from '@angular/material/card';
import {AreaChartComponent} from '@app/components/area-chart/area-chart.component';
import {configureTestSuite} from 'ng-bullet';
import {MockComponent} from 'ng-mocks';

import {AppHistoryComponent} from './app-history.component';
Expand All @@ -28,11 +27,11 @@ describe('AppHistoryComponent', () => {
let component: AppHistoryComponent;
let fixture: ComponentFixture<AppHistoryComponent>;

configureTestSuite(() => {
beforeAll(() => {
TestBed.configureTestingModule({
declarations: [AppHistoryComponent, MockComponent(AreaChartComponent)],
imports: [MatCardModule],
});
}).compileComponents();
});

beforeEach(() => {
Expand Down
5 changes: 2 additions & 3 deletions src/app/components/app-status/app-status.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {MatCardModule} from '@angular/material/card';
import {DonutChartComponent} from '@app/components/donut-chart/donut-chart.component';
import {configureTestSuite} from 'ng-bullet';
import {MockComponent} from 'ng-mocks';

import {AppStatusComponent} from './app-status.component';
Expand All @@ -28,11 +27,11 @@ describe('AppStatusComponent', () => {
let component: AppStatusComponent;
let fixture: ComponentFixture<AppStatusComponent>;

configureTestSuite(() => {
beforeAll(() => {
TestBed.configureTestingModule({
declarations: [AppStatusComponent, MockComponent(DonutChartComponent)],
imports: [MatCardModule],
});
}).compileComponents();
});

beforeEach(() => {
Expand Down
5 changes: 2 additions & 3 deletions src/app/components/area-chart/area-chart.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
*/

import {ComponentFixture, TestBed} from '@angular/core/testing';
import {configureTestSuite} from 'ng-bullet';

import {AreaChartComponent} from './area-chart.component';

describe('AreaChartComponent', () => {
let component: AreaChartComponent;
let fixture: ComponentFixture<AreaChartComponent>;

configureTestSuite(() => {
beforeAll(() => {
TestBed.configureTestingModule({
declarations: [AreaChartComponent],
});
}).compileComponents();
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {MatCardModule} from '@angular/material/card';
import {AreaChartComponent} from '@app/components/area-chart/area-chart.component';
import {configureTestSuite} from 'ng-bullet';
import {MockComponent} from 'ng-mocks';

import {ContainerHistoryComponent} from './container-history.component';
Expand All @@ -28,11 +27,11 @@ describe('ContainerHistoryComponent', () => {
let component: ContainerHistoryComponent;
let fixture: ComponentFixture<ContainerHistoryComponent>;

configureTestSuite(() => {
beforeAll(() => {
TestBed.configureTestingModule({
declarations: [ContainerHistoryComponent, MockComponent(AreaChartComponent)],
imports: [MatCardModule],
});
}).compileComponents();
});

beforeEach(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {MatCardModule} from '@angular/material/card';
import {DonutChartComponent} from '@app/components/donut-chart/donut-chart.component';
import {configureTestSuite} from 'ng-bullet';
import {MockComponent} from 'ng-mocks';

import {ContainerStatusComponent} from './container-status.component';
Expand All @@ -28,11 +27,11 @@ describe('ContainerStatusComponent', () => {
let component: ContainerStatusComponent;
let fixture: ComponentFixture<ContainerStatusComponent>;

configureTestSuite(() => {
beforeAll(() => {
TestBed.configureTestingModule({
declarations: [ContainerStatusComponent, MockComponent(DonutChartComponent)],
imports: [MatCardModule],
});
}).compileComponents();
});

beforeEach(() => {
Expand Down
5 changes: 2 additions & 3 deletions src/app/components/dashboard/dashboard.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import { ComponentFixture, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { configureTestSuite } from 'ng-bullet';
import { MatCardModule } from '@angular/material/card';
import { MatMenuModule } from '@angular/material/menu';
import { NgxSpinnerService } from 'ngx-spinner';
Expand All @@ -42,7 +41,7 @@ describe('DashboardComponent', () => {
let component: DashboardComponent;
let fixture: ComponentFixture<DashboardComponent>;

configureTestSuite(() => {
beforeAll(() => {
TestBed.configureTestingModule({
declarations: [
DashboardComponent,
Expand All @@ -58,7 +57,7 @@ describe('DashboardComponent', () => {
{ provide: NgxSpinnerService, useValue: MockNgxSpinnerService },
{ provide: EventBusService, useValue: MockEventBusService },
],
});
}).compileComponents();
});

beforeEach(() => {
Expand Down
5 changes: 2 additions & 3 deletions src/app/components/donut-chart/donut-chart.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,17 @@
*/

import {ComponentFixture, TestBed} from '@angular/core/testing';
import {configureTestSuite} from 'ng-bullet';

import {DonutChartComponent} from './donut-chart.component';

describe('DonutChartComponent', () => {
let component: DonutChartComponent;
let fixture: ComponentFixture<DonutChartComponent>;

configureTestSuite(() => {
beforeAll(() => {
TestBed.configureTestingModule({
declarations: [DonutChartComponent],
});
}).compileComponents();
});

beforeEach(() => {
Expand Down
5 changes: 2 additions & 3 deletions src/app/components/error-view/error-view.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@
import {ComponentFixture, TestBed} from '@angular/core/testing';
import {MatCardModule} from '@angular/material/card';
import {RouterTestingModule} from '@angular/router/testing';
import {configureTestSuite} from 'ng-bullet';

import {ErrorViewComponent} from './error-view.component';

describe('ErrorViewComponent', () => {
let component: ErrorViewComponent;
let fixture: ComponentFixture<ErrorViewComponent>;

configureTestSuite(() => {
beforeAll(() => {
TestBed.configureTestingModule({
imports: [MatCardModule, RouterTestingModule],
declarations: [ErrorViewComponent],
});
}).compileComponents();
});

beforeEach(() => {
Expand Down
5 changes: 2 additions & 3 deletions src/app/components/nodes-view/nodes-view.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import { NgxSpinnerService } from 'ngx-spinner';
import { configureTestSuite } from 'ng-bullet';

import { NodesViewComponent } from './nodes-view.component';
import { SchedulerService } from '@app/services/scheduler/scheduler.service';
Expand All @@ -35,7 +34,7 @@ describe('NodesViewComponent', () => {
let component: NodesViewComponent;
let fixture: ComponentFixture<NodesViewComponent>;

configureTestSuite(() => {
beforeAll(() => {
TestBed.configureTestingModule({
declarations: [NodesViewComponent],
imports: [
Expand All @@ -51,7 +50,7 @@ describe('NodesViewComponent', () => {
{ provide: NgxSpinnerService, useValue: MockNgxSpinnerService },
{ provide: HAMMER_LOADER, useValue: () => new Promise(() => {}) },
],
});
}).compileComponents();
});

beforeEach(() => {
Expand Down
5 changes: 2 additions & 3 deletions src/app/components/queue-rack/queue-rack.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,18 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { MatCardModule } from '@angular/material/card';
import { MatProgressBarModule } from '@angular/material/progress-bar';
import { configureTestSuite } from 'ng-bullet';

import { QueueRackComponent } from './queue-rack.component';

describe('QueueRackComponent', () => {
let component: QueueRackComponent;
let fixture: ComponentFixture<QueueRackComponent>;

configureTestSuite(() => {
beforeAll(() => {
TestBed.configureTestingModule({
declarations: [QueueRackComponent],
imports: [MatCardModule, MatProgressBarModule],
});
}).compileComponents();
});

beforeEach(() => {
Expand Down
5 changes: 2 additions & 3 deletions src/app/components/queues-view/queues-view.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import {RouterTestingModule} from '@angular/router/testing';
import {QueueRackComponent} from '@app/components/queue-rack/queue-rack.component';
import {SchedulerService} from '@app/services/scheduler/scheduler.service';
import {MockNgxSpinnerService, MockSchedulerService} from '@app/testing/mocks';
import {configureTestSuite} from 'ng-bullet';
import {MockComponent} from 'ng-mocks';
import {NgxSpinnerService} from 'ngx-spinner';

Expand All @@ -35,7 +34,7 @@ describe('QueuesViewComponent', () => {
let component: QueuesViewComponent;
let fixture: ComponentFixture<QueuesViewComponent>;

configureTestSuite(() => {
beforeAll(() => {
TestBed.configureTestingModule({
declarations: [QueuesViewComponent, MockComponent(QueueRackComponent)],
imports: [
Expand All @@ -49,7 +48,7 @@ describe('QueuesViewComponent', () => {
{ provide: SchedulerService, useValue: MockSchedulerService },
{ provide: NgxSpinnerService, useValue: MockNgxSpinnerService },
],
});
}).compileComponents();
});

beforeEach(() => {
Expand Down
5 changes: 2 additions & 3 deletions src/app/interceptors/api-error/api-error.interceptor.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@

import {TestBed} from '@angular/core/testing';
import {RouterTestingModule} from '@angular/router/testing';
import {configureTestSuite} from 'ng-bullet';

import {ApiErrorInterceptor} from './api-error.interceptor';

describe('ApiErrorInterceptor', () => {
let interceptor: ApiErrorInterceptor;

configureTestSuite(() => {
beforeAll(() => {
TestBed.configureTestingModule({
imports: [RouterTestingModule],
providers: [ApiErrorInterceptor],
});
}).compileComponents();
});

beforeEach(() => {
Expand Down
5 changes: 2 additions & 3 deletions src/app/services/envconfig/envconfig.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,17 @@

import {HttpClientTestingModule} from '@angular/common/http/testing';
import {TestBed} from '@angular/core/testing';
import {configureTestSuite} from 'ng-bullet';

import {EnvconfigService} from './envconfig.service';

describe('EnvconfigService', () => {
let service: EnvconfigService;

configureTestSuite(() => {
beforeAll(() => {
TestBed.configureTestingModule({
imports: [HttpClientTestingModule],
providers: [EnvconfigService],
});
}).compileComponents();
});

beforeEach(() => {
Expand Down
5 changes: 2 additions & 3 deletions src/app/services/event-bus/event-bus.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@
*/

import {TestBed} from '@angular/core/testing';
import {configureTestSuite} from 'ng-bullet';

import {EventBusService} from './event-bus.service';

describe('EventBusService', () => {
let service: EventBusService;

configureTestSuite(() => {
beforeAll(() => {
TestBed.configureTestingModule({
providers: [EventBusService],
});
}).compileComponents();
});

beforeEach(() => {
Expand Down
Loading

0 comments on commit 221662f

Please sign in to comment.