Top "Jasmine" questions

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

Angular - unit test for a subscribe function in a component

Angular 4 unit test for a subscribe. I want to test that my subscribe returns an array of Users. I want …

angular unit-testing jasmine karma-jasmine
How to test a function which has a setTimeout with jasmine?

I need to write a test for a function that has a setTimeout() call inside, but i can't find how …

javascript jquery unit-testing settimeout jasmine
jasmine mock window object

How do I mock window object? I'm doing firefox extension and I want to use jasmine for javascript testing. In …

javascript mocking jasmine
AngularJS Protractor - Finding an Element on a Page Using Ng-Click Binding

I have a button on a page that looks like: <button ng-click="myFunction()" ng-show="flag"> Submit </button&…

jasmine protractor
Angular Material and Jasmine : " No provider for InjectionToken MdDialogData! "

I have a component which is meant to be used in an Angular Material MdDialog : @Component({ ... }) export class MyComponent { constructor(@…

angular jasmine angular-material angular-material2 mddialog
How to mock an activatedRoute parent Route in angular2 for testing purposes?

Let's say I have this export class QuestionnaireQuestionsComponent { questions: Question[] = []; private loading:boolean = true; constructor( private route: ActivatedRoute, public questionnaireService:…

unit-testing angular typescript mocking jasmine
Expect Arrays to be equal ignoring order

With Jasmine is there a way to test if 2 arrays contain the same elements, but are not necessarily in the …

javascript jasmine karma-jasmine
How to unit test a FormControl in Angular2

My method under test is the following: /** * Update properties when the applicant changes the payment term value. * @return {Mixed} - …

unit-testing angular jasmine angular2-forms angular2-testing
view console.log output in angular protractor jasmine test

How can I view console.log output in an angularjs protractor jasmine test? As of now, the browser closes by …

angularjs jasmine protractor
Error: [$injector:unpr] Unknown provider: in AngularJS Service Test

I am having a lot of trouble getting dependencies provided properly for an AngularJS service. I see a number of …

angularjs jasmine angularjs-service