All Questions
Tagged with angular16 karma-jasmine
8 questions
1
vote
1
answer
74
views
How to write unit test case for reactive form in angular 18
I am new for unit test case in angular.I am trying to write unit test case for angular reactive fomr. But, It is not working properly.
Getting below error some times
Error: NG01052: formGroup expects ...
0
votes
0
answers
19
views
How to get NGRX reducer state value inside spec ts file in angular 16
I am not able to get reducer state value inside spec ts. Getting below error.
An error was thrown in afterAll
TypeError: Cannot read properties of undefined (reading 'isLoading')
app.component.ts:
...
2
votes
1
answer
76
views
How to write unit test case for angular code
I am trying to to write test case for my angular project. I am using angular version 16.
Below is my code.
In my code I am not getting component.appRuleList and component.appRuleOptions values in my ...
1
vote
0
answers
10
views
How to resolve setFormControlValue issue in angular
I am getting below the error in the test case error in my angular 16 application.
Error: NG0302: The pipe 'setFormControlValue' could not be found in the 'AppComponent' component. Verify that it is ...
0
votes
1
answer
253
views
Jasmine Karma not working Angular 16 upgrade
I have upgraded angular from 15 to 16 but when I run ng test, it is not including any component.spec.ts files and it fails all the test cases:
package.json:
"karma": "6.3.17",
...
0
votes
0
answers
69
views
Angular 16 Test case fails - was thrown in afterAll
Migrated the Angualr application from 6 to 16 and the test cases failing with below errors.
enter image description here
Package.json
enter image description here
Karma.js
enter image description here
...
2
votes
1
answer
2k
views
Writing unit tests for simple Angular functions which using inject() method in Angular 16
After Angular CanActivate interface became deprecated, I've changed my guards for simple const functions based on official documentation.
For example here is my inverseAuthGuard method, which seems ...
0
votes
1
answer
261
views
Jasmine test case for checkbox event handler Angular 16, jasmine 4.3.5
I have to test below function
addAll($event: any) {
this.Deletion = [];
if ($event['srcElement']['checked']) {
this.Model.forEach(file => {
this.Deletion.push(file.docId);
...