File

src/client/app/modules/test/shorthand/ng2-jasmine.ts

Index

Properties
Methods

Methods

async
async(fn: Function)
Returns : Function
be
be(fn: Function)
Returns : void
beforeEach
beforeEach(fn: Function)
Returns : void
e
e(actual: any)
expect
expect(actual: any)
fail
fail(e: any)
Returns : void
fakeAsync
fakeAsync(fn: Function)
Returns : Function
fit
fit(name: string, fn: Function, timeOut: number)
Returns : void
inject
inject(tokens: Array, fn: Function)
Returns : Function
it
it(name: string, fn: Function, timeOut: number)
Returns : void
pending
pending(reason: string)
Returns : void
spyOn
spyOn(object: any, method: string)
tick
tick(delay: number)
Returns : void
xit
xit(name: string, fn: Function, timeOut: number)
Returns : void

Properties

ae
ae: Function
Type : Function
afterEach
afterEach: Function
Type : Function
describe
describe: Function
Type : Function
fdescribe
fdescribe: Function
Type : Function
xdescribe
xdescribe: Function
Type : Function
import {
  async,
  fakeAsync,
  inject,
  tick
} from '@angular/core/testing';

// intellisense via shorthand
export interface TestApi {
  ae: Function;
  afterEach: Function;
  describe: Function;
  fdescribe: Function;
  xdescribe: Function;
  async(fn: Function): Function;
  fakeAsync(fn: Function): Function;
  be(fn: Function): void;
  beforeEach(fn: Function): void;
  e(actual: any): jasmine.Matchers;
  expect(actual: any): jasmine.Matchers;
  fail(e?: any): void;
  inject(tokens: Array<any>, fn: Function): Function;
  it(name: string, fn: Function, timeOut?: number): void;
  fit(name: string, fn: Function, timeOut?: number): void;
  xit(name: string, fn: Function, timeOut?: number): void;
  pending(reason?: string): void;
  spyOn(object: any, method: string): jasmine.Spy;
  tick(delay?: number): void;
}

// shorthand - reduces boilerplate in every test
export const Ng2Jasmine: TestApi = {
  ae: afterEach, // shorthand
  afterEach: afterEach,
  describe: describe,
  fdescribe: fdescribe,
  xdescribe: xdescribe,
  async: async,
  fakeAsync: fakeAsync,
  be: beforeEach,  // shorthand beforeEach
  beforeEach: beforeEach,
  e: expect, // shorthand expect
  expect: expect,
  fail: fail,
  inject: inject,
  it: it,
  fit: fit,
  xit: xit,
  pending: pending,
  spyOn: spyOn,
  tick: tick
};

results matching ""

    No results matching ""