* Added npm script 'lint:tsc' to check for unused local variables & parameters.
Notice that vars/params beginning with '_' are ignored by compiler.
* tslint: removed 'no-unused-variable' controversial rule in favor of compiler checks.
* Added npm script 'test:config' to address 'lint:tsc' complaining about
not finding module 'unit-test-configuration.ts'.
Signed-off-by: Alfonso MartÃnez <almartin@redhat.com>
"jasmine",
"jasminewd2",
"node"
- ]
+ ],
+ "noEmit": true
}
}
"build": "npm run env_build && ng build",
"env_build": "cp src/environments/environment.tpl.ts src/environments/environment.prod.ts && cp src/environments/environment.tpl.ts src/environments/environment.ts && node ./environment.build.js",
"i18n": "ng xi18n --i18n-format xlf --i18n-locale en-US --output-path locale --progress=false && ngx-extractor -i 'src/**/*.ts' -f xlf -o src/locale/messages.xlf -l en-US",
- "test": "jest --watch",
- "test:ci": "JEST_SILENT_REPORTER_DOTS=true jest --coverage --reporters jest-silent-reporter",
+ "test": "npm run test:config && jest --watch",
+ "test:ci": "npm run test:config && JEST_SILENT_REPORTER_DOTS=true jest --coverage --reporters jest-silent-reporter",
+ "test:config": "if [ ! -e 'src/unit-test-configuration.ts' ]; then cp 'src/unit-test-configuration.ts.sample' 'src/unit-test-configuration.ts'; fi",
"e2e": "npm run env_build && ng e2e",
"e2e:dev": "npm run env_build && ng e2e --dev-server-target",
"lint:tslint": "ng lint",
"lint:prettier": "prettier --list-different \"{src,e2e}/**/*.{ts,scss}\"",
"lint:html": "html-linter --config html-linter.config.json",
- "lint": "npm run lint:tslint && npm run lint:prettier && npm run lint:html",
+ "lint:tsc": "npm run test:config && tsc -p src/tsconfig.app.json --noEmit --noUnusedLocals --noUnusedParameters && tsc -p src/tsconfig.spec.json --noEmit --noUnusedLocals --noUnusedParameters && tsc -p e2e/tsconfig.e2e.json --noEmit --noUnusedLocals --noUnusedParameters",
+ "lint": "npm run lint:tsc && npm run lint:tslint && npm run lint:prettier && npm run lint:html",
"fix:prettier": "prettier --write \"{src,e2e}/**/*.{ts,scss}\"",
"fix:tslint": "npm run lint:tslint -- --fix",
"fixmod": "prettier --write $(git rev-parse --show-toplevel)/$(git status --porcelain | grep -E '^(\\sM|\\?\\?|A)' | sed -e 's/^...//' | grep -E '^(src|e2e).*\\.(ts|scss)$') 1>/dev/null 2>&1 && echo 'done' || echo 'no changes found'",
"modulePathIgnorePatterns": [
"<rootDir>/coverage/"
],
+ "testMatch": [
+ "**/*.spec.ts"
+ ],
"testURL": "http://localhost/"
},
"dependencies": {
const currentSettings = this.imagesSettings[this.image];
this.helpText = this.iscsiService.imageAdvancedSettings;
- _.forIn(this.disk_default_controls, (value, key) => {
+ _.forIn(this.disk_default_controls, (_value, key) => {
fg[key] = new FormControl(currentSettings[key]);
});
const fg = {};
this.helpText = this.iscsiService.targetAdvancedSettings;
- _.forIn(this.target_default_controls, (value, key) => {
+ _.forIn(this.target_default_controls, (_value, key) => {
fg[key] = new FormControl(this.target_controls.value[key]);
});
const fakeService = {
tcmuiscsi: () => {
- return new Promise(function(resolve, reject) {
+ return new Promise(function() {
return;
});
}
name: 'mirrorHealthColor'
})
export class MirrorHealthColorPipe implements PipeTransform {
- transform(value: any, args?: any): any {
+ transform(value: any): any {
if (value === 'warning') {
return 'label label-warning';
} else if (value === 'error') {
client_id: string;
mon_host: string;
key: string;
+ uuid: string;
}
icon: 'fa-plus',
name: this.i18n('Add Peer'),
click: () => this.editPeersModal('add'),
- disable: (selection: CdTableSelection) =>
- !this.selection.first() || this.selection.first().mirror_mode === 'disabled',
- visible: (selection: CdTableSelection) => !this.getPeerUUID(),
+ disable: () => !this.selection.first() || this.selection.first().mirror_mode === 'disabled',
+ visible: () => !this.getPeerUUID(),
canBePrimary: () => false
};
const editPeerAction: CdTableAction = {
icon: 'fa-exchange',
name: this.i18n('Edit Peer'),
click: () => this.editPeersModal('edit'),
- visible: (selection: CdTableSelection) => !!this.getPeerUUID()
+ visible: () => !!this.getPeerUUID()
};
const deletePeerAction: CdTableAction = {
permission: 'delete',
icon: 'fa-times',
name: this.i18n('Delete Peer'),
click: () => this.deletePeersModal(),
- visible: (selection: CdTableSelection) => !!this.getPeerUUID()
+ visible: () => !!this.getPeerUUID()
};
this.tableActions = [editModeAction, addPeerAction, editPeerAction, deletePeerAction];
}
-import { SimpleChange } from '@angular/core';
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { FormsModule } from '@angular/forms';
import { RouterTestingModule } from '@angular/router/testing';
} as RbdConfigurationEntry;
component.data = [fakeOption, realOption];
- component.ngOnChanges({ name: new SimpleChange(null, null, null) });
+ component.ngOnChanges();
expect(component.data.length).toBe(1);
expect(component.data.pop()).toBe(realOption);
-import {
- Component,
- Input,
- OnChanges,
- OnInit,
- SimpleChanges,
- TemplateRef,
- ViewChild
-} from '@angular/core';
+import { Component, Input, OnChanges, OnInit, TemplateRef, ViewChild } from '@angular/core';
import { I18n } from '@ngx-translate/i18n-polyfill';
import { CdTableColumn } from '../../../shared/models/cd-table-column';
];
}
- ngOnChanges(changes: SimpleChanges): void {
+ ngOnChanges(): void {
if (!this.data) {
return;
}
this.rbdService
.renameSnapshot(this.poolName, this.imageName, this.snapName, snapshotName)
.toPromise()
- .then((resp) => {
+ .then(() => {
this.taskManagerService.subscribe(
finishedTask.name,
finishedTask.metadata,
this.modalRef.hide();
this.onSubmit.next(this.snapName);
})
- .catch((resp) => {
+ .catch(() => {
this.snapshotForm.setErrors({ cdSubmitButton: true });
});
}
this.rbdService
.createSnapshot(this.poolName, this.imageName, snapshotName)
.toPromise()
- .then((resp) => {
+ .then(() => {
this.taskManagerService.subscribe(
finishedTask.name,
finishedTask.metadata,
this.modalRef.hide();
this.onSubmit.next(snapshotName);
})
- .catch((resp) => {
+ .catch(() => {
this.snapshotForm.setErrors({ cdSubmitButton: true });
});
}
fixture.detectChanges();
const i18n = TestBed.get(I18n);
called = false;
- rbdService = new RbdService(null);
- notificationService = new NotificationService(null, null);
+ rbdService = new RbdService(null, null);
+ notificationService = new NotificationService(null, null, null);
authStorageService = new AuthStorageService();
authStorageService.set('user', '', { 'rbd-image': ['create', 'read', 'update', 'delete'] });
component = new RbdSnapshotListComponent(
this.rbdService
.protectSnapshot(this.poolName, this.rbdName, snapshotName, !isProtected)
.toPromise()
- .then((resp) => {
+ .then(() => {
const executingTask = new ExecutingTask();
executingTask.name = finishedTask.name;
executingTask.metadata = finishedTask.metadata;
}
);
})
- .catch((resp) => {
+ .catch(() => {
this.modalRef.content.stopLoadingSpinner();
});
}
{
name: this.i18n('Usage'),
cellTemplate: this.poolUsageTpl,
- comparator: (valueA, valueB, rowA, rowB, sortDirection) => {
+ comparator: (_valueA, _valueB, rowA, rowB) => {
const valA = rowA.used / rowA.avail;
const valB = rowB.used / rowB.avail;
});
this.cephfsService.getMdsCounters(this.id).subscribe((data) => {
- _.each(this.mdsCounters, (value, key) => {
+ _.each(this.mdsCounters, (_value, key) => {
if (data[key] === undefined) {
delete this.mdsCounters[key];
}
});
}
- trackByFn(index, item) {
+ trackByFn(_index, item) {
return item.name;
}
}
const expectOpensModal = (actionName: string, modalClass): void => {
openActionModal(actionName);
- expect(modalServiceShowSpy.calls.any()).toBe(true, 'modalService.show called');
+ // @TODO: check why tsc is complaining when passing 'expectationFailOutput' param.
+ expect(modalServiceShowSpy.calls.any()).toBeTruthy();
expect(modalServiceShowSpy.calls.first().args[0]).toBe(modalClass);
modalServiceShowSpy.calls.reset();
const fakeService = {
list: () => {
- return new Promise(function(resolve, reject) {
- return {};
- });
+ return new Promise(() => {});
},
- scrub: (data: any) => {
- return new Promise(function(resolve, reject) {
- return {};
- });
+ scrub: () => {
+ return new Promise(() => {});
},
- scrub_many: (data: any) => {
- return new Promise(function(resolve, reject) {
- return {};
- });
+ scrub_many: () => {
+ return new Promise(() => {});
}
};
const id = this.selected[0].id;
this.osdService.scrub(id, this.deep).subscribe(
- (res) => {
+ () => {
const operation = this.deep ? 'Deep scrub' : 'Scrub';
this.notificationService.show(
}
private hideSlices() {
- _.forEach(this.chartConfig.dataset[0].data, (slice, sliceIndex) => {
+ _.forEach(this.chartConfig.dataset[0].data, (_slice, sliceIndex) => {
if (this.hiddenSlices[sliceIndex]) {
this.chartConfig.dataset[0].data[sliceIndex] = undefined;
}
});
}
- prepareReadWriteRatio(chart, data) {
+ prepareReadWriteRatio(chart) {
const ratioLabels = [];
const ratioData = [];
export class MdsSummaryPipe implements PipeTransform {
constructor(private i18n: I18n) {}
- transform(value: any, args?: any): any {
+ transform(value: any): any {
if (!value) {
return '';
}
let standbys = 0;
let active = 0;
let standbyReplay = 0;
- _.each(value.standbys, (s, i) => {
+ _.each(value.standbys, () => {
standbys += 1;
});
} else if (value.filesystems.length === 0) {
contentLine1 = this.i18n('no filesystems');
} else {
- _.each(value.filesystems, (fs, i) => {
- _.each(fs.mdsmap.info, (mds, j) => {
+ _.each(value.filesystems, (fs) => {
+ _.each(fs.mdsmap.info, (mds) => {
if (mds.state === 'up:standby-replay') {
standbyReplay += 1;
} else {
export class MgrSummaryPipe implements PipeTransform {
constructor(private i18n: I18n) {}
- transform(value: any, args?: any): any {
+ transform(value: any): any {
if (!value) {
return '';
}
export class MonSummaryPipe implements PipeTransform {
constructor(private i18n: I18n) {}
- transform(value: any, args?: any): any {
+ transform(value: any): any {
if (!value) {
return '';
}
export class OsdSummaryPipe implements PipeTransform {
constructor(private i18n: I18n) {}
- transform(value: any, args?: any): any {
+ transform(value: any): any {
if (!value) {
return '';
}
}
getData(promises) {
- forkJoin(promises).subscribe(
- (data: any[]) => {
- this.resolveDaemons(data[0]);
- this.resolvefsals(data[1]);
- this.resolveClients(data[2]);
- this.resolveFilesystems(data[3]);
- if (data[4]) {
- this.resolveModel(data[4]);
- }
- },
- (error) => {
- // this.error = error;
+ forkJoin(promises).subscribe((data: any[]) => {
+ this.resolveDaemons(data[0]);
+ this.resolvefsals(data[1]);
+ this.resolveClients(data[2]);
+ this.resolveFilesystems(data[3]);
+ if (data[4]) {
+ this.resolveModel(data[4]);
}
- );
+ });
}
createForm() {
this.builders
);
},
- (error) => {
+ () => {
this.onFetchError();
}
);
})
.subscribe(
undefined,
- (resp) => {
+ () => {
this.form.setErrors({ cdSubmitButton: true });
},
() => {
describe('getPgStatusCellClass', () => {
const testMethod = (value, expected) =>
- expect(component.getPgStatusCellClass({ row: '', column: '', value: value })).toEqual({
+ expect(component.getPgStatusCellClass('', '', value)).toEqual({
'text-right': true,
[expected]: true
});
name: this.i18n('PG Status'),
flexGrow: 3,
cellClass: ({ row, column, value }): any => {
- return this.getPgStatusCellClass({ row, column, value });
+ return this.getPgStatusCellClass(row, column, value);
}
},
{
});
}
- getPgStatusCellClass({ row, column, value }): object {
+ getPgStatusCellClass(_row, _column, value): object {
return {
'text-right': true,
[`pg-${this.pgCategoryService.getTypeByStates(value)}`]: true
});
it('should ensure no modal dialogs are opened', () => {
- component.bsModalService.modalsCount = 2;
+ component['bsModalService']['modalsCount'] = 2;
component.ngOnInit();
- expect(component.bsModalService.getModalsCount()).toBe(0);
+ expect(component['bsModalService'].getModalsCount()).toBe(0);
});
});
cephfs: ['read', 'delete'],
grafana: ['update']
});
- component.onClickHeaderCheckbox('scope', { target: { checked: false } });
+ component.onClickHeaderCheckbox('scope', ({
+ target: { checked: false }
+ } as unknown) as Event);
const scopes_permissions = form.getValue('scopes_permissions');
expect(scopes_permissions).toEqual({});
});
cephfs: ['create', 'update'],
grafana: ['delete']
});
- component.onClickHeaderCheckbox('scope', { target: { checked: true } });
+ component.onClickHeaderCheckbox('scope', ({ target: { checked: true } } as unknown) as Event);
const scopes_permissions = form.getValue('scopes_permissions');
const keys = Object.keys(scopes_permissions);
expect(keys).toEqual(['cephfs', 'grafana']);
it('should alert if user is removing needed role permission', () => {
spyOn(TestBed.get(AuthStorageService), 'getUsername').and.callFake(() => user.username);
let modalBodyTpl = null;
- spyOn(modalService, 'show').and.callFake((content, config) => {
+ spyOn(modalService, 'show').and.callFake((_content, config) => {
modalBodyTpl = config.initialState.bodyTpl;
});
formHelper.setValue('roles', ['read-only']);
image_error: [],
image_syncing: [],
image_ready: []
- }
+ },
+ executing_tasks: [{}]
};
configureTestBed(
mockFixture = TestBed.createComponent(MockComponent);
mockComponent = mockFixture.componentInstance;
// Mocking the modals as a lot would be left over
- spyOn(mockComponent.modalService, 'show').and.callFake((modalComp, config) => {
+ spyOn(mockComponent.modalService, 'show').and.callFake((_modalComp, config) => {
const ref = new BsModalRef();
fixture = TestBed.createComponent(CriticalConfirmationModalComponent);
component = fixture.componentInstance;
this.grafanaSrc = this.sanitizer.bypassSecurityTrustResourceUrl(this.url);
}
- onTimepickerChange(event) {
+ onTimepickerChange() {
if (this.grafanaExist) {
this.getFrame();
}
}
}
- ngOnChanges(changes) {
+ ngOnChanges() {
if (this.grafanaExist) {
this.getFrame();
}
constructor(private dimlessBinaryPipe: DimlessBinaryPipe) {}
ngOnInit() {
- const getStyleTop = (tooltip, positionY) => {
+ const getStyleTop = (tooltip) => {
return tooltip.caretY - tooltip.height - tooltip.yPadding - 5 + 'px';
};
this.useData();
}
- ngOnChanges(changes) {
+ ngOnChanges() {
this.useData();
}
it('should test search manipulation', () => {
let searchTerms = [];
- spyOn(component, 'subSearch').and.callFake((d, search) => {
+ spyOn(component, 'subSearch').and.callFake((_d, search) => {
expect(search).toEqual(searchTerms);
});
const searchTest = (s: string, st: string[]) => {
return _.isEmpty(css) ? undefined : css;
}
- ngOnChanges(changes) {
+ ngOnChanges() {
this.useData();
}
name: 'empty'
})
export class EmptyPipe implements PipeTransform {
- transform(value: any, args?: any): any {
+ transform(value: any): any {
return _.isUndefined(value) || _.isNull(value) ? '-' : value;
}
}
export class CdDatePipe implements PipeTransform {
constructor(private datePipe: DatePipe) {}
- transform(value: any, args?: any): any {
+ transform(value: any): any {
if (value === null || value === '') {
return '';
}
name: 'cephReleaseName'
})
export class CephReleaseNamePipe implements PipeTransform {
- transform(value: any, args?: any): any {
+ transform(value: any): any {
// Expect "ceph version 13.1.0-419-g251e2515b5
// (251e2515b563856349498c6caf34e7a282f62937) nautilus (dev)"
const result = /ceph version\s+[^ ]+\s+\(.+\)\s+(.+)\s+\((.+)\)/.exec(value);
name: 'cephShortVersion'
})
export class CephShortVersionPipe implements PipeTransform {
- transform(value: any, args?: any): any {
+ transform(value: any): any {
// Expect "ceph version 1.2.3-g9asdasd (as98d7a0s8d7)"
const result = /ceph version\s+([^ ]+)\s+\(.+\)/.exec(value);
if (result) {
export class DimlessBinaryPerSecondPipe implements PipeTransform {
constructor(private formatter: FormatterService) {}
- transform(value: any, args?: any): any {
+ transform(value: any): any {
return this.formatter.format_number(value, 1024, [
'B/s',
'kB/s',
export class DimlessBinaryPipe implements PipeTransform {
constructor(private formatter: FormatterService) {}
- transform(value: any, args?: any): any {
+ transform(value: any): any {
return this.formatter.format_number(value, 1024, [
'B',
'KiB',
export class DimlessPipe implements PipeTransform {
constructor(private formatter: FormatterService) {}
- transform(value: any, args?: any): any {
+ transform(value: any): any {
return this.formatter.format_number(value, 1000, ['', 'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y']);
}
}
const filters = [
{
value: '',
- applyFilter: (row, val) => {
+ applyFilter: () => {
return false;
}
}
name: 'healthColor'
})
export class HealthColorPipe implements PipeTransform {
- transform(value: any, args?: any): any {
+ transform(value: any): any {
if (value === 'HEALTH_OK') {
return { color: '#00bb00' };
} else if (value === 'HEALTH_WARN') {
name: 'iops'
})
export class IopsPipe implements PipeTransform {
- transform(value: any, args?: any): any {
+ transform(value: any): any {
return `${value} IOPS`;
}
}
name: 'list'
})
export class ListPipe implements PipeTransform {
- transform(value: any, args?: any): any {
+ transform(value: any): any {
return value.join(', ');
}
}
name: 'logPriority'
})
export class LogPriorityPipe implements PipeTransform {
- transform(value: any, args?: any): any {
+ transform(value: any): any {
if (value === '[INF]') {
return 'info';
} else if (value === '[WRN]') {
name: 'milliseconds'
})
export class MillisecondsPipe implements PipeTransform {
- transform(value: any, args?: any): any {
+ transform(value: any): any {
return `${value} ms`;
}
}
export class RelativeDatePipe implements PipeTransform {
constructor() {}
- transform(value: any, args?: any): any {
+ transform(value: any): any {
if (!value) {
return 'unknown';
}
let router: Router;
const url = 'api/xyz';
- const httpError = (error, errorOpts, done = (resp) => {}) => {
+ const httpError = (error, errorOpts, done = (_resp) => {}) => {
httpClient.get(url).subscribe(
() => {},
(resp) => {
it('should allow the user if loggedIn', () => {
spyOn(authStorageService, 'isLoggedIn').and.returnValue(true);
- expect(service.canActivate(null, null)).toBe(true);
+ expect(service.canActivate()).toBe(true);
});
it('should prevent user if not loggedIn and redirect to login page', fakeAsync(() => {
const router = TestBed.get(Router);
ngZone.run(() => {
- expect(service.canActivate(null, null)).toBe(false);
+ expect(service.canActivate()).toBe(false);
});
tick();
expect(router.url).toBe('/login');
import { Injectable } from '@angular/core';
-import {
- ActivatedRouteSnapshot,
- CanActivate,
- CanActivateChild,
- Router,
- RouterStateSnapshot
-} from '@angular/router';
+import { CanActivate, CanActivateChild, Router } from '@angular/router';
import { AuthStorageService } from './auth-storage.service';
import { ServicesModule } from './services.module';
export class AuthGuardService implements CanActivate, CanActivateChild {
constructor(private router: Router, private authStorageService: AuthStorageService) {}
- canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
+ canActivate() {
if (this.authStorageService.isLoggedIn()) {
return true;
}
return false;
}
- canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
- return this.canActivate(route, state);
+ canActivateChild(): boolean {
+ return this.canActivate();
}
}
});
it('should store username', () => {
- service.set(username);
+ service.set(username, '');
expect(localStorage.getItem('dashboard_username')).toBe(username);
});
it('should remove username', () => {
- service.set(username);
+ service.set(username, '');
service.remove();
expect(localStorage.getItem('dashboard_username')).toBe(null);
});
it('should be loggedIn', () => {
- service.set(username);
+ service.set(username, '');
expect(service.isLoggedIn()).toBe(true);
});
ngZone.run(() => {
service
- .canActivate(<ActivatedRouteSnapshot>{ routeConfig: { path: path } }, null)
+ .canActivate(<ActivatedRouteSnapshot>{ routeConfig: { path: path } })
.subscribe((val) => (result = val));
});
tick();
import { Injectable } from '@angular/core';
-import {
- ActivatedRouteSnapshot,
- CanActivate,
- CanActivateChild,
- Router,
- RouterStateSnapshot
-} from '@angular/router';
+import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router } from '@angular/router';
import { map } from 'rxjs/operators';
export class FeatureTogglesGuardService implements CanActivate, CanActivateChild {
constructor(private router: Router, private featureToggles: FeatureTogglesService) {}
- canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
+ canActivate(route: ActivatedRouteSnapshot) {
return this.featureToggles.get().pipe(
map((enabledFeatures: FeatureTogglesMap) => {
if (enabledFeatures[route.routeConfig.path] === false) {
);
}
- canActivateChild(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
- return this.canActivate(route.parent, state);
+ canActivateChild(route: ActivatedRouteSnapshot) {
+ return this.canActivate(route.parent);
}
}
expect(service.toBytes('1.1 kib')).toBeNull();
expect(service.toBytes('1.kib')).toBeNull();
expect(service.toBytes('1 ki')).toBeNull();
- expect(service.toBytes()).toBeNull();
+ expect(service.toBytes(undefined)).toBeNull();
expect(service.toBytes('')).toBeNull();
expect(service.toBytes('-')).toBeNull();
expect(service.toBytes(null)).toBeNull();
let result: boolean;
spyOn(httpClient, 'get').and.returnValue(observableOf(getResult));
ngZone.run(() => {
- service.canActivateChild(route, null).subscribe((resp) => {
+ service.canActivateChild(route).subscribe((resp) => {
result = resp;
});
});
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
-import {
- ActivatedRouteSnapshot,
- CanActivate,
- CanActivateChild,
- Router,
- RouterStateSnapshot
-} from '@angular/router';
+import { ActivatedRouteSnapshot, CanActivate, CanActivateChild, Router } from '@angular/router';
import { of as observableOf } from 'rxjs';
import { catchError, map } from 'rxjs/operators';
export class ModuleStatusGuardService implements CanActivate, CanActivateChild {
constructor(private http: HttpClient, private router: Router) {}
- canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
+ canActivate(route: ActivatedRouteSnapshot) {
return this.doCheck(route);
}
- canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
+ canActivateChild(childRoute: ActivatedRouteSnapshot) {
return this.doCheck(childRoute);
}
let notifications: CdNotification[] = [];
if (_.isString(stringNotifications)) {
- notifications = JSON.parse(stringNotifications, (key, value) => {
+ notifications = JSON.parse(stringNotifications, (_key, value) => {
if (_.isPlainObject(value)) {
return _.assign(new CdNotification(), value);
}
const resp = { status: 500, error: {} };
service = new PrometheusAlertService(null, <PrometheusService>{
ifAlertmanagerConfigured: (fn) => fn(),
- list: () => ({ subscribe: (fn, err) => err(resp) })
+ list: () => ({ subscribe: (_fn, err) => err(resp) })
});
expect(service['connected']).toBe(true);
'rbd/mirroring/pool/edit': this.newTaskMessage(
this.commonOperations.update,
this.rbd_mirroring.pool,
- (metadata) => ({
+ () => ({
16: this.i18n('Cannot disable mirroring because it contains a peer.')
})
),
'rbd/mirroring/peer/add': this.newTaskMessage(
this.commonOperations.create,
this.rbd_mirroring.pool_peer,
- (metadata) => ({})
+ () => ({})
),
'rbd/mirroring/peer/edit': this.newTaskMessage(
this.commonOperations.update,
this.rbd_mirroring.pool_peer,
- (metadata) => ({})
+ () => ({})
),
'rbd/mirroring/peer/delete': this.newTaskMessage(
this.commonOperations.delete,
this.rbd_mirroring.pool_peer,
- (metadata) => ({})
+ () => ({})
),
// iSCSI target tasks
'iscsi/target/create': this.newTaskMessage(this.commonOperations.create, (metadata) =>
it('should call notifyTask if asynchronous task would have been finished', () => {
const taskManager = TestBed.get(TaskManagerService);
- spyOn(taskManager, 'subscribe').and.callFake((name, metadata, onTaskFinished) => {
+ spyOn(taskManager, 'subscribe').and.callFake((_name, _metadata, onTaskFinished) => {
onTaskFinished();
});
callWrapTaskAroundCall(202, 'async').subscribe(null, null, () => (passed = true));
Object.defineProperty(window, 'sessionStorage', { value: mock() });
Object.defineProperty(window, 'getComputedStyle', {
value: () => ({
- getPropertyValue: (prop) => {
+ getPropertyValue: () => {
return '';
}
})
},
"exclude": [
"**/*.spec.ts",
- "test.ts",
"testing/*.ts"
]
}
"module": "commonjs",
"target": "es5",
"types": [
- "jasmine",
+ "jest",
"node"
- ]
+ ],
+ "noEmit": true
},
"files": [
- "test.ts",
"polyfills.ts"
],
"include": [
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unused-expression": true,
- "no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
}
],
"unified-signatures": true,
- "variable-name": [true, "check-format", "allow-snake-case"],
+ "variable-name": [true, "check-format", "allow-snake-case", "allow-leading-underscore"],
"whitespace": [
true,
"check-branch",