diff --git a/.github/workflows/angular.yml b/.github/workflows/angular.yml index 7c09188c4..3e20ba100 100644 --- a/.github/workflows/angular.yml +++ b/.github/workflows/angular.yml @@ -1,17 +1,19 @@ -name: Angular CI +name: Angular Unit Tests on: workflow_dispatch: jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: 16 + node-version: 18 cache: 'npm' - - name: Install dependencies and run tests + cache-dependency-path: 'ui/package-lock.json' + - name: Install dependencies working-directory: ui - run: | - npm i - npm test \ No newline at end of file + run: npm ci + - name: Run tests + working-directory: ui + run: npm test \ No newline at end of file diff --git a/ui/karma.conf.js b/ui/karma.conf.js index adeb7b3b6..e4f96d35d 100644 --- a/ui/karma.conf.js +++ b/ui/karma.conf.js @@ -37,8 +37,8 @@ module.exports = function (config) { colors: true, logLevel: config.LOG_INFO, autoWatch: true, - browsers: ['Chrome'], - singleRun: false, + browsers: ['ChromeHeadless'], + singleRun: true, restartOnFileChange: true }); }; diff --git a/ui/src/app/app.component.spec.ts b/ui/src/app/app.component.spec.ts index 9d787d782..2c21743bf 100644 --- a/ui/src/app/app.component.spec.ts +++ b/ui/src/app/app.component.spec.ts @@ -1,12 +1,14 @@ import { TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; +import { HttpClientTestingModule } from '@angular/common/http/testing'; import { AppComponent } from './app.component'; describe('AppComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [ - RouterTestingModule + RouterTestingModule, + HttpClientTestingModule ], declarations: [ AppComponent