Category "jasmine"

Data Type Jasmine

I'm a beginner in angular test with jasmine and i need to test data type(e.g. String, int, etc.) This is my controller, my data is instantiated to null and la

.detectChanges() not working within Angular test

I've been tasked with writing tests for a chat app developed with Angular. Below is the snippet of Angular template code I'm currently writing tests for: <

How jasmine spyOn a generic method

I try to make a spy on a generic method in typescript, but cannot get Jasmine to recognise it. I have code http: HttpClient <- Not proper code, just showin

How to spyOn a global function and return a value in Jasmine

How can I spy on MyFunction and return 2 in Jasmine 2.0? I have the following code that errors on the first line inside shouldPass with: Error: function My

How to write unit test for a service having breakpoint observer?

I have a service having a breakpoint observer. But how we can trigger window resize event for breakpoint observer to cover all branch and lines. export class B

How to write unit test for a service having breakpoint observer?

I have a service having a breakpoint observer. But how we can trigger window resize event for breakpoint observer to cover all branch and lines. export class B

Cannot Locate Element using Jasmine (Protractor)

The login page is a non-angular page and when the user login, then s/he is redirected to home page. The home page is using angular. For login, I've used

AngularJS: How to jasmine test callback function in directive?

I have a very simple directive which creates a HighCharts graph. I have only included the most important for this question: angular.module('myModule').directiv

jasmine: Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL

I have an angular service called requestNotificationChannel: app.factory("requestNotificationChannel", function($rootScope) { var _DELETE_MESSAGE_ = "_DEL

ERROR in ./src/polyfills.ts Module not found: Error: Can't resolve 'zone.js/dist/zone'

I have an angular 8, that uses karma/jasmine to run some unit tests. I can run tests by executing the following command ng test but I'm getting the following er