ANGULAR 2 Using a class within a test case provided that the class is already being used as a provider in the module -
i using class named params provider within module , want use same class inside test case.
'export class params { public firstname: string = 'abhishek'; public lastname: string = 'parashar'; public website: string = 'parashar.com'; }`
here spec file want use it.
'import { usersparams } '../../../comp/users/core/users.params'; export class testdata { static userparams: usersparams = { public firstname: string = 'abhishek'; public lastname: string = 'parashar'; public website: string = 'parashar.com'; }; describe('test case', () => { beforeeach(() => { testbed.configuretestingmodule({ providers: [ { provide: usersparams, useclass: usersparams} ] }); });' it('should users list', inject([componentparams], fakeasync() => {} ););
i want use componentparams inside unit test case creently unable use it
Comments
Post a Comment