mardi 13 septembre 2016

Angular2 rc.6 Karma Testing

Im new to the whole TTD with karma and jasmin, Im trying to run a test on my service which pull data from my DB, but I keep getting errors saying that ReferenceError: Can't find variable: beforeEachProviders in karma-test-shim.js here is my test below..

import { TracksServices } from './tracks.services.ts';

describe('Service: TracksServices', () => {

let service;
//setup
beforeEachProviders(() => [
    HTTP_PROVIDERS, 
    TracksServices
]);

beforeEach(inject([TracksServices], s => {
    service = s;
}));

it('get 4 featured images', done => {

    service.featured(1, 4).subscribe(x => { 

      expect(x).toContain(track);
      expect(x.length).toEqual(4);
      done();

    });

});

});

Aucun commentaire:

Enregistrer un commentaire