Most voted "karma" questions
9 questions
Sort by count of
-
1
votes1
answer644
viewsUnit Service Testing Using Karma (typescript/angular)
I’m trying to test a service GET method: get(url: string, params?: any): Observable<Response> { let options = {}; this.securityService.setHeaders(options); if (params) this.setParams(options,…
-
0
votes1
answer312
viewsKarma unit tests (typescript/angular)
I am trying to perform a unit test for a method made in typescript, this is the method: createTasksForms(): void { this.task.forEach(task => { task.form = this.form.group({ name: ['',…
-
0
votes1
answer270
viewsUnit Karma Test for Typescript/Angular Method
I’m having trouble testing a method of select, that’s the method: select(task): any { (document.getElementById(task) as HTMLInputElement).select(); }; It is called by html, in this part here:…
-
0
votes1
answer84
viewsDependency injection problems in Angular unit tests
I’m trying to perform unit tests in Angular, but I have some problems with injection dependencies in the services. In the application there are several services that depend on each other, for…
-
0
votes1
answer75
viewsUnit Test Rxjs + Ngrx Subscription in Angular with Karma
I’m having difficulty executing unit test for the following function: subscribeToUsuario(): void { this.subscription.add( this.store$.pipe(select(selectors.selectUsuario)).subscribe(state => { if…
-
0
votes1
answer23
viewsERROR Nullinjectorerror: R3injectorerror(Dynamictestmodule)[Kdsdialogservice -> Matdialog -> Matdialog]: Nullinjectorerror: No Provider for Matdialog
I am doing unit testing in an application of mine. I am beginner regarding testing, so I need your help. In my application I do a service using Matdialog ( Kdsdialogservice). I have tried putting…
-
-1
votes1
answer52
viewsError testing Activatedroute with angular jest 9
First thank you for reading my question! Setting: I’m testing an angular 9 application with jest of a component using a solver class'. I tried to set up a mock to resolve it, but when running tests…
-
-2
votes1
answer100
viewsJasmine error - Uncaught [Object Object] thrown
When I run my test I get the following error Uncaught [object Object] thrown Every time the test is run he says the error is in a different location, I can’t understand the reason. Sometimes the…
-
-2
votes1
answer70
viewsProblem with Antdesign icons when testing Angular application
The component I am testing uses Ant Design icons, and when running Karma tests with the 'npm run test' command the following error occurs: An error was thrown in afterall error properties: Object({…