From 0a00bc8af2af4993d34e2183ed5f919ce7d93666 Mon Sep 17 00:00:00 2001 From: Kuan-Po Tseng Date: Mon, 27 Nov 2023 17:30:25 +0800 Subject: [PATCH] [YUNIKORN-2081] Update karma in web UI test --- package.json | 3 +- src/app/app.component.spec.ts | 5 ++-- .../app-history/app-history.component.spec.ts | 5 ++-- .../app-status/app-status.component.spec.ts | 5 ++-- .../area-chart/area-chart.component.spec.ts | 5 ++-- .../container-history.component.spec.ts | 5 ++-- .../container-status.component.spec.ts | 5 ++-- .../dashboard/dashboard.component.spec.ts | 5 ++-- .../donut-chart/donut-chart.component.spec.ts | 5 ++-- .../error-view/error-view.component.spec.ts | 5 ++-- .../nodes-view/nodes-view.component.spec.ts | 5 ++-- .../queue-rack/queue-rack.component.spec.ts | 5 ++-- .../queues-view/queues-view.component.spec.ts | 5 ++-- .../api-error/api-error.interceptor.spec.ts | 5 ++-- .../envconfig/envconfig.service.spec.ts | 5 ++-- .../event-bus/event-bus.service.spec.ts | 5 ++-- yarn.lock | 30 ++++++------------- 17 files changed, 40 insertions(+), 68 deletions(-) diff --git a/package.json b/package.json index d6f3b8f5..33ab1337 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/app/app.component.spec.ts b/src/app/app.component.spec.ts index 09a318a4..04cc7f8a 100644 --- a/src/app/app.component.spec.ts +++ b/src/app/app.component.spec.ts @@ -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'; @@ -32,7 +31,7 @@ describe('AppComponent', () => { let component: AppComponent; let fixture: ComponentFixture; - configureTestSuite(() => { + beforeAll(() => { TestBed.configureTestingModule({ declarations: [AppComponent], imports: [RouterTestingModule, NgxSpinnerModule, MatMenuModule, MatTooltipModule], @@ -40,7 +39,7 @@ describe('AppComponent', () => { { provide: EventBusService, useValue: MockEventBusService }, { provide: HAMMER_LOADER, useValue: () => new Promise(() => {}) }, ], - }); + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/components/app-history/app-history.component.spec.ts b/src/app/components/app-history/app-history.component.spec.ts index ee092c13..d54c4543 100644 --- a/src/app/components/app-history/app-history.component.spec.ts +++ b/src/app/components/app-history/app-history.component.spec.ts @@ -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'; @@ -28,11 +27,11 @@ describe('AppHistoryComponent', () => { let component: AppHistoryComponent; let fixture: ComponentFixture; - configureTestSuite(() => { + beforeAll(() => { TestBed.configureTestingModule({ declarations: [AppHistoryComponent, MockComponent(AreaChartComponent)], imports: [MatCardModule], - }); + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/components/app-status/app-status.component.spec.ts b/src/app/components/app-status/app-status.component.spec.ts index bcf2d334..f791d92b 100644 --- a/src/app/components/app-status/app-status.component.spec.ts +++ b/src/app/components/app-status/app-status.component.spec.ts @@ -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'; @@ -28,11 +27,11 @@ describe('AppStatusComponent', () => { let component: AppStatusComponent; let fixture: ComponentFixture; - configureTestSuite(() => { + beforeAll(() => { TestBed.configureTestingModule({ declarations: [AppStatusComponent, MockComponent(DonutChartComponent)], imports: [MatCardModule], - }); + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/components/area-chart/area-chart.component.spec.ts b/src/app/components/area-chart/area-chart.component.spec.ts index ea7486be..7ac5cac5 100644 --- a/src/app/components/area-chart/area-chart.component.spec.ts +++ b/src/app/components/area-chart/area-chart.component.spec.ts @@ -17,7 +17,6 @@ */ import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {configureTestSuite} from 'ng-bullet'; import {AreaChartComponent} from './area-chart.component'; @@ -25,10 +24,10 @@ describe('AreaChartComponent', () => { let component: AreaChartComponent; let fixture: ComponentFixture; - configureTestSuite(() => { + beforeAll(() => { TestBed.configureTestingModule({ declarations: [AreaChartComponent], - }); + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/components/container-history/container-history.component.spec.ts b/src/app/components/container-history/container-history.component.spec.ts index dc55cb15..9a863567 100644 --- a/src/app/components/container-history/container-history.component.spec.ts +++ b/src/app/components/container-history/container-history.component.spec.ts @@ -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'; @@ -28,11 +27,11 @@ describe('ContainerHistoryComponent', () => { let component: ContainerHistoryComponent; let fixture: ComponentFixture; - configureTestSuite(() => { + beforeAll(() => { TestBed.configureTestingModule({ declarations: [ContainerHistoryComponent, MockComponent(AreaChartComponent)], imports: [MatCardModule], - }); + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/components/container-status/container-status.component.spec.ts b/src/app/components/container-status/container-status.component.spec.ts index bbb615af..cc886631 100644 --- a/src/app/components/container-status/container-status.component.spec.ts +++ b/src/app/components/container-status/container-status.component.spec.ts @@ -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'; @@ -28,11 +27,11 @@ describe('ContainerStatusComponent', () => { let component: ContainerStatusComponent; let fixture: ComponentFixture; - configureTestSuite(() => { + beforeAll(() => { TestBed.configureTestingModule({ declarations: [ContainerStatusComponent, MockComponent(DonutChartComponent)], imports: [MatCardModule], - }); + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/components/dashboard/dashboard.component.spec.ts b/src/app/components/dashboard/dashboard.component.spec.ts index 43efdd27..189a48e9 100644 --- a/src/app/components/dashboard/dashboard.component.spec.ts +++ b/src/app/components/dashboard/dashboard.component.spec.ts @@ -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'; @@ -42,7 +41,7 @@ describe('DashboardComponent', () => { let component: DashboardComponent; let fixture: ComponentFixture; - configureTestSuite(() => { + beforeAll(() => { TestBed.configureTestingModule({ declarations: [ DashboardComponent, @@ -58,7 +57,7 @@ describe('DashboardComponent', () => { { provide: NgxSpinnerService, useValue: MockNgxSpinnerService }, { provide: EventBusService, useValue: MockEventBusService }, ], - }); + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/components/donut-chart/donut-chart.component.spec.ts b/src/app/components/donut-chart/donut-chart.component.spec.ts index abbf3aa2..531ca04b 100644 --- a/src/app/components/donut-chart/donut-chart.component.spec.ts +++ b/src/app/components/donut-chart/donut-chart.component.spec.ts @@ -17,7 +17,6 @@ */ import {ComponentFixture, TestBed} from '@angular/core/testing'; -import {configureTestSuite} from 'ng-bullet'; import {DonutChartComponent} from './donut-chart.component'; @@ -25,10 +24,10 @@ describe('DonutChartComponent', () => { let component: DonutChartComponent; let fixture: ComponentFixture; - configureTestSuite(() => { + beforeAll(() => { TestBed.configureTestingModule({ declarations: [DonutChartComponent], - }); + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/components/error-view/error-view.component.spec.ts b/src/app/components/error-view/error-view.component.spec.ts index fd3571f6..7fa275d1 100644 --- a/src/app/components/error-view/error-view.component.spec.ts +++ b/src/app/components/error-view/error-view.component.spec.ts @@ -19,7 +19,6 @@ 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'; @@ -27,11 +26,11 @@ describe('ErrorViewComponent', () => { let component: ErrorViewComponent; let fixture: ComponentFixture; - configureTestSuite(() => { + beforeAll(() => { TestBed.configureTestingModule({ imports: [MatCardModule, RouterTestingModule], declarations: [ErrorViewComponent], - }); + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/components/nodes-view/nodes-view.component.spec.ts b/src/app/components/nodes-view/nodes-view.component.spec.ts index 2c4d2302..9f61f997 100644 --- a/src/app/components/nodes-view/nodes-view.component.spec.ts +++ b/src/app/components/nodes-view/nodes-view.component.spec.ts @@ -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'; @@ -35,7 +34,7 @@ describe('NodesViewComponent', () => { let component: NodesViewComponent; let fixture: ComponentFixture; - configureTestSuite(() => { + beforeAll(() => { TestBed.configureTestingModule({ declarations: [NodesViewComponent], imports: [ @@ -51,7 +50,7 @@ describe('NodesViewComponent', () => { { provide: NgxSpinnerService, useValue: MockNgxSpinnerService }, { provide: HAMMER_LOADER, useValue: () => new Promise(() => {}) }, ], - }); + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/components/queue-rack/queue-rack.component.spec.ts b/src/app/components/queue-rack/queue-rack.component.spec.ts index 89b5d10c..0095d728 100644 --- a/src/app/components/queue-rack/queue-rack.component.spec.ts +++ b/src/app/components/queue-rack/queue-rack.component.spec.ts @@ -19,7 +19,6 @@ 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'; @@ -27,11 +26,11 @@ describe('QueueRackComponent', () => { let component: QueueRackComponent; let fixture: ComponentFixture; - configureTestSuite(() => { + beforeAll(() => { TestBed.configureTestingModule({ declarations: [QueueRackComponent], imports: [MatCardModule, MatProgressBarModule], - }); + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/components/queues-view/queues-view.component.spec.ts b/src/app/components/queues-view/queues-view.component.spec.ts index 2d85e4dc..eba63a03 100644 --- a/src/app/components/queues-view/queues-view.component.spec.ts +++ b/src/app/components/queues-view/queues-view.component.spec.ts @@ -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'; @@ -35,7 +34,7 @@ describe('QueuesViewComponent', () => { let component: QueuesViewComponent; let fixture: ComponentFixture; - configureTestSuite(() => { + beforeAll(() => { TestBed.configureTestingModule({ declarations: [QueuesViewComponent, MockComponent(QueueRackComponent)], imports: [ @@ -49,7 +48,7 @@ describe('QueuesViewComponent', () => { { provide: SchedulerService, useValue: MockSchedulerService }, { provide: NgxSpinnerService, useValue: MockNgxSpinnerService }, ], - }); + }).compileComponents(); }); beforeEach(() => { diff --git a/src/app/interceptors/api-error/api-error.interceptor.spec.ts b/src/app/interceptors/api-error/api-error.interceptor.spec.ts index 27d51920..b04c23ca 100644 --- a/src/app/interceptors/api-error/api-error.interceptor.spec.ts +++ b/src/app/interceptors/api-error/api-error.interceptor.spec.ts @@ -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(() => { diff --git a/src/app/services/envconfig/envconfig.service.spec.ts b/src/app/services/envconfig/envconfig.service.spec.ts index ba049d21..75ba328c 100644 --- a/src/app/services/envconfig/envconfig.service.spec.ts +++ b/src/app/services/envconfig/envconfig.service.spec.ts @@ -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(() => { diff --git a/src/app/services/event-bus/event-bus.service.spec.ts b/src/app/services/event-bus/event-bus.service.spec.ts index eca365d1..c33740f0 100644 --- a/src/app/services/event-bus/event-bus.service.spec.ts +++ b/src/app/services/event-bus/event-bus.service.spec.ts @@ -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(() => { diff --git a/yarn.lock b/yarn.lock index 015f3493..e98114b8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5689,10 +5689,10 @@ jackspeak@^2.0.3: optionalDependencies: "@pkgjs/parseargs" "^0.11.0" -jasmine-core@^3.6.0: - version "3.99.1" - resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-3.99.1.tgz#5bfa4b2d76618868bfac4c8ff08bb26fffa4120d" - integrity sha512-Hu1dmuoGcZ7AfyynN3LsfruwMbxMALMka+YtZeGoLuDEySVmVAPaonkNoBRIw/ectu8b9tVQCJNgp4a4knp+tg== +jasmine-core@^4.1.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/jasmine-core/-/jasmine-core-4.6.0.tgz#6884fc3d5b66bf293e422751eed6d6da217c38f5" + integrity sha512-O236+gd0ZXS8YAjFx8xKaJ94/erqUliEkJTDedyE7iHvv4ZVqi+q+8acJxu05/WJDKm512EUNn809In37nWlAQ== jasmine-core@~5.1.1: version "5.1.1" @@ -5899,12 +5899,12 @@ karma-jasmine-html-reporter@~2.1.0: resolved "https://registry.yarnpkg.com/karma-jasmine-html-reporter/-/karma-jasmine-html-reporter-2.1.0.tgz#f951ad00b08d61d03595402c914d1a589c4930e3" integrity sha512-sPQE1+nlsn6Hwb5t+HHwyy0A1FNCVKuL1192b+XNauMYWThz2kweiBVW1DqloRpVvZIJkIoHVB7XRpK78n1xbQ== -karma-jasmine@~4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-4.0.2.tgz#386db2a3e1acc0af5265c711f673f78f1e4938de" - integrity sha512-ggi84RMNQffSDmWSyyt4zxzh2CQGwsxvYYsprgyR1j8ikzIduEdOlcLvXjZGwXG/0j41KUXOWsUCBfbEHPWP9g== +karma-jasmine@~5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/karma-jasmine/-/karma-jasmine-5.1.0.tgz#3af4558a6502fa16856a0f346ec2193d4b884b2f" + integrity sha512-i/zQLFrfEpRyQoJF9fsCdTMOF5c2dK7C7OmsuKg2D0YSsuZSfQDiLuaiktbuio6F2wiCsZSnSnieIQ0ant/uzQ== dependencies: - jasmine-core "^3.6.0" + jasmine-core "^4.1.0" karma-source-map-support@1.4.0: version "1.4.0" @@ -6543,13 +6543,6 @@ netmask@^2.0.2: resolved "https://registry.yarnpkg.com/netmask/-/netmask-2.0.2.tgz#8b01a07644065d536383835823bc52004ebac5e7" integrity sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg== -ng-bullet@^1.0.3: - version "1.0.3" - resolved "https://registry.npmjs.org/ng-bullet/-/ng-bullet-1.0.3.tgz" - integrity sha512-qacsE/w/pLlBxebort1rkrE2B4Vc3idutcpe7tYiHVarz0V6Q5SN8E3d6NUp4UFBMOucpHlCpaASp7qEOsxM1Q== - dependencies: - tslib "^1.9.0" - ng-mocks@^14.11.0: version "14.11.0" resolved "https://registry.yarnpkg.com/ng-mocks/-/ng-mocks-14.11.0.tgz#3f37d309b7e76ebec01604a4d15893d9406e668a" @@ -8344,11 +8337,6 @@ tslib@2.6.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.1.tgz#fd8c9a0ff42590b25703c0acb3de3d3f4ede0410" integrity sha512-t0hLfiEKfMUoqhG+U1oid7Pva4bbDPHYfJNiB7BiIjRkj1pyC++4N3huJfqY6aRH6VTB0rvtzQwjM4K6qpfOig== -tslib@^1.9.0: - version "1.14.1" - resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" - integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== - tslib@^2.0.1, tslib@^2.0.3, tslib@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"