File

src/app/tests/mocks/confirm.ts

Description

Mock for ConfirmService.

Create a mocked service: const confirmService = new MockConfirmService(); TestBed.configureTestingModule({ providers: [ { provide: ConfirmService, useValue: confirmService } ] }).compileComponents();

Example

Index

Methods

Methods

open
open(title: string, description: string, options: any)
Parameters :
Name Type Optional Description
title string
description string
options any
Returns : Observable<any>
import { Observable, of } from 'rxjs';

/**
 * Mock for {@link ConfirmService}.
 *
 * Create a mocked service:
 * const confirmService = new MockConfirmService();
 * TestBed.configureTestingModule({
 *   providers: [
 *     { provide: ConfirmService, useValue: confirmService }
 *   ]
 * }).compileComponents();
 *
 * @author Damien Vitrac
 */
export class MockConfirmService {

  open(title: string, description: string, options: any = {}): Observable<any> {
    return of({});
  }

}

results matching ""

    No results matching ""