Top "Jasmine" questions

Jasmine is a behavior-driven development (BDD) framework for testing JavaScript code.

Spying on JQuery Selectors in Jasmine

I am unit testing some JavaScript with Jasmine and wish to spy on (mock) an element of the DOM that …

jquery unit-testing jasmine
How to mock Angular 4.3 httpClient an error response in testing

I have a below interceptor auth-interceptor.service.ts import {Injectable, Injector} from '@angular/core'; import {HttpErrorResponse, HttpEvent, HttpHandler, HttpInterceptor, …

angular typescript jasmine angular-http-interceptors angular-httpclient
How to check multiple arguments on multiple calls for jest spies?

I have the following function in a React component: onUploadStart(file, xhr, formData) { formData.append('filename', file.name); formData.append(…

javascript typescript unit-testing jasmine jestjs
angular2 test, how do I mock sub component

How do I mock sub component in jasmine tests? I have MyComponent, which uses MyNavbarComponent and MyToolbarComponent import {Component} from …

unit-testing testing jasmine angular components
How to test a prop update on React component

What is the correct way of unit testing a React component prop update. Here is my test fixture; describe('updating …

unit-testing jasmine reactjs
Error: No provider for "framework:jasmine"! (Resolving: framework:jasmine)

I have run on my windows console: npm install -g yo grunt-cli bower npm install -g generator-angular yo angular Then …

npm jasmine karma-runner karma-jasmine
Spy on a service method call using jasmine Spies

I have the following controller ViewMeetingCtrl.js (function () { 'use strict'; angular.module('MyApp').controller('ViewMeetingCtrl', ViewMeetingCtrl); ViewMeetingCtrl.$inject = ['$scope', …

angularjs unit-testing jasmine karma-runner karma-jasmine
Jasmine tests check if html contains text and return boolean

expect(view.$el.html()).toContain('Admin'); The view does contain the word 'Admin' so I was expecting it to return …

javascript jquery jasmine karma-jasmine
spyOn could not find an object to spy upon for start()

I am using angular-cli testing framework. inside my component , I have used 'ng2-slim-loading-bar' node module. submit(){ this._slimLoadingBarService.start(() =&…

javascript angular typescript jasmine angular2-testing
Is there an Array equality match function that ignores element position in jest.js?

I get that .toEqual() checks equality of all fields for plain objects: expect( {"key1":"pink wool","key2":"diorite"} ).toEqual( {"key2":"…

jasmine jestjs