Fix for unit tests

This commit is contained in:
piotrpekala7 2020-08-26 12:39:55 +02:00
parent 29a8b9f527
commit 910ddb9955
3 changed files with 12 additions and 6 deletions

View File

@ -9,7 +9,7 @@ import { ElectronService, NgxElectronModule } from 'ngx-electron';
import createSpyObj = jasmine.createSpyObj; import createSpyObj = jasmine.createSpyObj;
import { NO_ERRORS_SCHEMA } from '@angular/core'; import { NO_ERRORS_SCHEMA } from '@angular/core';
import { ProgressService } from './common/progress/progress.service'; import { ProgressService } from './common/progress/progress.service';
import 'jasmine'; // import 'jasmine';
describe('AppComponent', () => { describe('AppComponent', () => {
let component: AppComponent; let component: AppComponent;

View File

@ -14,11 +14,16 @@ import { SettingsService } from '../../services/settings.service';
import { ToasterService } from '../../services/toaster.service'; import { ToasterService } from '../../services/toaster.service';
import { MockedToasterService } from '../../services/toaster.service.spec'; import { MockedToasterService } from '../../services/toaster.service.spec';
import { ConsoleService } from '../../services/settings/console.service'; import { ConsoleService } from '../../services/settings/console.service';
import { MapSettingsService } from '../../services/mapsettings.service';
describe('SettingsComponent', () => { describe('SettingsComponent', () => {
let component: SettingsComponent; let component: SettingsComponent;
let fixture: ComponentFixture<SettingsComponent>; let fixture: ComponentFixture<SettingsComponent>;
let settingsService: SettingsService; let settingsService: SettingsService;
let mapSettingsService = {
integrateLinkLabelsToLinks: true,
toggleIntegrateInterfaceLabels(val: boolean) {}
};
let consoleService; let consoleService;
beforeEach(async(() => { beforeEach(async(() => {
@ -31,7 +36,8 @@ describe('SettingsComponent', () => {
providers: [ providers: [
SettingsService, SettingsService,
{ provide: ToasterService, useClass: MockedToasterService }, { provide: ToasterService, useClass: MockedToasterService },
{ provide: ConsoleService, useValue: consoleService} { provide: ConsoleService, useValue: consoleService },
{ provide: MapSettingsService, useValue: mapSettingsService }
], ],
declarations: [SettingsComponent] declarations: [SettingsComponent]
}).compileComponents(); }).compileComponents();

View File

@ -26,21 +26,21 @@
], ],
}, },
"include": [ "include": [
"./src/**/*", "./src/**/*"
], ],
"exclude": [ "exclude": [
"src/test.ts", //"src/test.ts",
"src/app/cartography/testing.ts", "src/app/cartography/testing.ts",
"src/app/cartography/tool.ts", "src/app/cartography/tool.ts",
"src/app/cartography/widgets/drawings.backup.ts", "src/app/cartography/widgets/drawings.backup.ts",
"src/app/converters/converter.ts", "src/app/converters/converter.ts",
"src/app/models/software.ts", "src/app/models/software.ts",
"src/app/services/testing.ts", "src/app/services/testing.ts",
"src/app/testing/app-testing/app-testing.module.ts", // "src/app/testing/app-testing/app-testing.module.ts",
"src/environments/environment.electron.prod.ts", "src/environments/environment.electron.prod.ts",
"src/environments/environment.electron.ts", "src/environments/environment.electron.ts",
"src/environments/environment.github.prod.ts", "src/environments/environment.github.prod.ts",
"src/environments/environment.prod.ts", "src/environments/environment.prod.ts",
"**/*.spec.ts" // "**/*.spec.ts"
] ]
} }