karma jasmine - Angular 2 basic test fails -


i getting started angular2 , testing: jasmine & karma. wrote few sanity tests worked fine when attempt simple default injector test fails:

using-injector.spec.ts  describe('default test injector', () => {   it('should provide default id', inject([app_id], (id) => {     expect(id).tobe('a');   })); }); 

the error see in karma:

failed: no provider token appid! error: di exception     @ noprovidererror.baseexception [as constructor] (c:/users/f ocuments/dev/node_modules/angular2/bundles/angular2.js:7587:21) ... 

any hint highly appreciated

i specify app_id within beforeeachproviders function.

beforeeachproviders(() => [   app_id ]); 

then should able inject it.


Comments