merge-requests/3/merge
Nato Boram 2020-07-07 20:20:02 -04:00
parent c050381c49
commit 03f3975132
No known key found for this signature in database
GPG Key ID: 478E3C64BF88AFFA
7 changed files with 27 additions and 27 deletions

View File

@ -196,6 +196,7 @@
},
"defaultProject": "public-gateway-cacher",
"cli": {
"packageManager": "yarn"
"packageManager": "yarn",
"analytics": "10b848ad-8b81-4346-852f-5eff89573a85"
}
}
}

View File

@ -1,19 +1,19 @@
import { browser, logging } from 'protractor';
import { AppPage } from './app.po';
describe('workspace-project App', () => {
describe('workspace-project App', (): void => {
let page: AppPage;
beforeEach(() => {
beforeEach((): void => {
page = new AppPage();
});
it('should display welcome message', () => {
it('should display welcome message', (): void => {
page.navigateTo();
expect(page.getTitleText()).toEqual('public-gateway-cacher app is running!');
});
afterEach(async () => {
afterEach(async (): Promise<void> => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({

View File

@ -1,9 +1,9 @@
import { TestBed, async } from '@angular/core/testing';
import { async, TestBed } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';
describe('AppComponent', () => {
beforeEach(async(() => {
describe('AppComponent', (): void => {
beforeEach(async((): void => {
TestBed.configureTestingModule({
imports: [
RouterTestingModule
@ -14,19 +14,19 @@ describe('AppComponent', () => {
}).compileComponents();
}));
it('should create the app', () => {
it('should create the app', (): void => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app).toBeTruthy();
});
it(`should have as title 'public-gateway-cacher'`, () => {
it(`should have as title 'public-gateway-cacher'`, (): void => {
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('public-gateway-cacher');
});
it('should render title', () => {
it('should render title', (): void => {
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;

View File

@ -1,24 +1,24 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { PagesComponent } from './pages.component';
describe('PagesComponent', () => {
describe('PagesComponent', (): void => {
let component: PagesComponent;
let fixture: ComponentFixture<PagesComponent>;
beforeEach(async(() => {
beforeEach(async((): void => {
TestBed.configureTestingModule({
declarations: [PagesComponent]
})
.compileComponents();
}));
beforeEach(() => {
beforeEach((): void => {
fixture = TestBed.createComponent(PagesComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
it('should create', (): void => {
expect(component).toBeTruthy();
});
});

View File

@ -29,7 +29,7 @@ export class PagesComponent implements OnInit {
ngOnInit(): void {
this.dataSource = new MatTableDataSource([]);
this.gatewayService.list().subscribe(gateways => this.gateways = gateways);
this.gatewayService.list().subscribe((gateways): void => { this.gateways = gateways; });
}
cacheIPFS(): void {
@ -53,12 +53,12 @@ export class PagesComponent implements OnInit {
this.matTable.renderRows();
console.clear();
this.gateways.forEach(gateway => {
this.gateways.forEach((gateway): void => {
this.subscriptions.push(
this.gatewayService.get(gateway, type, hash).subscribe(_ => {
this.gatewayService.get(gateway, type, hash).subscribe((): void => {
this.dataSource.data.push({ gateway: `${gateway.replace(':type', type).replace(':hash', hash)}`, error: null });
this.matTable.renderRows();
}, (error: HttpErrorResponse) => {
}, (error: HttpErrorResponse): void => {
this.dataSource.data.push({ gateway: `${gateway.replace(':type', type).replace(':hash', hash)}`, error });
this.matTable.renderRows();
})

View File

@ -1,12 +1,11 @@
import { TestBed } from '@angular/core/testing';
import { TestBed, TestBedStatic } from '@angular/core/testing';
import { GatewayService } from './gateway.service';
describe('GatewayService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
describe('GatewayService', (): void => {
beforeEach((): TestBedStatic => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: GatewayService = TestBed.get(GatewayService);
it('should be created', (): void => {
const service: GatewayService = TestBed.inject(GatewayService);
expect(service).toBeTruthy();
});
});

View File

@ -8,4 +8,4 @@ if (environment.production) {
}
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
.catch((err): void => console.error(err));