beforeEach

export beforeEach(fn: FunctionWithParamTokens | AnyTestFn) : void

exported from angular2/testing defined in angular2/src/testing/testing.ts (line 215)

Wrapper around Jasmine beforeEach function.

beforeEach may be used with the inject function to fetch dependencies. The test will automatically wait for any asynchronous calls inside the injected test function to complete.

See http://jasmine.github.io/ for more details.

Example:

describe('some component', () => { beforeEach(() => { db.connect(); }); it('uses the db', () => { // Database is connected. }); });