[ACS-4865] setup and enable code coverage for all projects (#3074)

This commit is contained in:
Denys Vuika
2023-03-20 09:06:19 -04:00
committed by GitHub
parent 86c0bbb998
commit 9609393d1e
37 changed files with 1300 additions and 408 deletions

View File

@@ -1,32 +1,15 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
const { join } = require('path');
const getBaseKarmaConfig = require('../../karma.conf');
module.exports = function (config) {
const baseConfig = getBaseKarmaConfig();
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
...baseConfig,
coverageReporter: {
...baseConfig.coverageReporter,
dir: join(__dirname, '../../coverage/aca-content'),
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../../coverage/aca-content'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: true,
restartOnFileChange: true
});
};

View File

@@ -24,7 +24,7 @@
*/
import { NgModule } from '@angular/core';
import { TranslateService, TranslatePipe } from '@ngx-translate/core';
import { TranslatePipe, TranslateModule } from '@ngx-translate/core';
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
import {
TranslationService,
@@ -44,7 +44,6 @@ import { EffectsModule } from '@ngrx/effects';
import { MaterialModule } from '../material.module';
import { INITIAL_STATE } from '../store/initial-state';
import { TranslatePipeMock } from './translate-pipe.directive';
import { TranslateServiceMock } from '@alfresco/aca-shared';
import { BehaviorSubject, Observable, of } from 'rxjs';
@NgModule({
@@ -53,6 +52,7 @@ import { BehaviorSubject, Observable, of } from 'rxjs';
HttpClientModule,
RouterTestingModule,
MaterialModule,
TranslateModule.forRoot(),
StoreModule.forRoot(
{ app: appReducer },
{
@@ -71,7 +71,6 @@ import { BehaviorSubject, Observable, of } from 'rxjs';
providers: [
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
{ provide: TranslationService, useClass: TranslationMock },
{ provide: TranslateService, useClass: TranslateServiceMock },
{ provide: TranslatePipe, useClass: TranslatePipeMock },
{
provide: DiscoveryApiService,