All files / app/services/github github.service.ts

100% Statements 6/6
100% Branches 0/0
100% Functions 5/5
100% Lines 6/6

Kamil Chmielowski

Web / Angular

Jasmine code coverage report for cv app.

You can contact with me by email: kamilchmielowski94@gmail.com or my page.

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25                  1x 6x     4x   1x       2x   1x      
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
 
import { catchError, EMPTY, Observable } from 'rxjs';
 
import { environment } from '../../../environments/environment';
import { GithubCommits, GithubLanguages } from './github.model';
 
@Injectable({ providedIn: 'root' })
export class GithubService {
  constructor(private httpClient: HttpClient) {}
 
  getProjectLanguages(project: string): Observable<GithubLanguages> {
    return this.httpClient.get<GithubLanguages>(
      environment.github.apiUrl + environment.github.languagesEndpoint.replace('{project}', project)
    ).pipe(catchError(() => EMPTY));
  }
 
  getProjectCommits(project: string): Observable<GithubCommits[]> {
    return this.httpClient.get<GithubCommits[]>(
      environment.github.apiUrl + environment.github.commitsEndpoint.replace('{project}', project)
    ).pipe(catchError(() => EMPTY));
  }
}