Commit 7949a074 authored by François Agneray's avatar François Agneray
Browse files

Fixed bug coverage

parent 10d156dd
Pipeline #4795 passed with stages
in 10 minutes and 27 seconds
......@@ -62,7 +62,7 @@ sonar_scanner:
-Dsonar.host.url=$SONARQUBE_URL
-Dsonar.login=$SONAR_TOKEN
-Dsonar.exclusions=**.spec.ts
-Dsonar.typescript.lcov.reportPaths=./coverage/client/lcov.info
-Dsonar.typescript.lcov.reportPaths=./coverage/anis-admin/lcov.info
only:
refs:
- develop
......
......@@ -87,7 +87,6 @@
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"codeCoverage": true,
"assets": [
"src/favicon.ico",
"src/assets"
......
......@@ -26,7 +26,7 @@ module.exports = function (config) {
suppressAll: true // removes the duplicated traces
},
coverageReporter: {
dir: require('path').join(__dirname, './coverage/client'),
dir: require('path').join(__dirname, './coverage/anis-admin'),
subdir: '.',
reporters: [
{ type: 'html' },
......
import './app.module';
\ No newline at end of file
import './auth.module';
\ No newline at end of file
import './core.module';
\ No newline at end of file
import './metamodel.module';
\ No newline at end of file
export * from './renderer-config.model';
export * from './detail-renderer-config.model';
export * from './link-renderer-config.model';
\ No newline at end of file
export * from './link-renderer-config.model';
export * from './download-renderer-config.model';
\ No newline at end of file
import { RendererConfig, DetailRendererConfig, LinkRendererConfig } from './index';
import { RendererConfig, DetailRendererConfig, LinkRendererConfig, DownloadRendererConfig } from './index';
export abstract class RendererConfigFactory {
static create(renderer: string): RendererConfig {
......@@ -21,7 +21,7 @@ export abstract class RendererConfigFactory {
display: 'icon-button',
text: 'DOWNLOAD',
icon: 'fas fa-download'
}
} as DownloadRendererConfig;
}
}
}
\ No newline at end of file
export interface RendererConfig {
id: 'renderer-config';
}
import './settings.module';
\ No newline at end of file
......@@ -3,14 +3,26 @@ import { Routes, RouterModule } from '@angular/router';
import { SettingsComponent } from './containers/settings.component';
import { AuthGuard } from '../core/auth.guard';
import { environment } from 'src/environments/environment';
const routes: Routes = [
{ path: 'settings', canActivate: [AuthGuard], component: SettingsComponent },
{ path: 'settings/:select', canActivate: [AuthGuard], component: SettingsComponent }
{ path: 'settings', component: SettingsComponent },
{ path: 'settings/:select', component: SettingsComponent }
];
const routesGuarded = routes.map(r=> {
if (environment.authenticationEnabled) {
return {
...r,
canActivate: [AuthGuard]
};
} else {
return r;
}
});
@NgModule({
imports: [ RouterModule.forChild(routes) ],
imports: [ RouterModule.forChild(routesGuarded) ],
exports: [ RouterModule ]
})
export class SettingsRoutingModule { }
......
export interface AnisServerError {
message: string;
}
export * from './anis-server-error.model';
\ No newline at end of file
import './shared.module';
\ No newline at end of file
......@@ -7,14 +7,22 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: any;
declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
//const context = require.context('./', true, /\.spec\.ts$/);
const context = require.context('./', true, /\/app\/.*\.ts$/);
// And load the modules.
context.keys().map(context);
context.keys().forEach(context);
......@@ -10,9 +10,5 @@
],
"include": [
"src/**/*.d.ts"
],
"exclude": [
"src/test.ts",
"src/**/*.spec.ts"
]
}
......@@ -11,16 +11,12 @@
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
},
"angularCompilerOptions": {
"fullTemplateTypeCheck": true,
"strictInjectionParameters": true
"enableI18nLegacyMessageIdFormat": false
}
}
......@@ -3,8 +3,7 @@
"compilerOptions": {
"outDir": "./out-tsc/spec",
"types": [
"jasmine",
"node"
"jasmine"
]
},
"files": [
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment