Top "Jasmine" questions

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

How to write a test which expects an Error to be thrown in Jasmine?

I'm trying to write a test for the Jasmine Test Framework which expects an error. At the moment I'm using …

javascript testing node.js jasmine
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_ = "_DELETE_MESSAGE_"; function deleteMessage(id, …

javascript angularjs unit-testing asynchronous jasmine
Protractor : How to wait for page complete after click a button?

In a test spec, I need to click a button on a web page, and wait for the new page …

jasmine protractor wait
Jasmine JavaScript Testing - toBe vs toEqual

Let's say I have the following: var myNumber = 5; expect(myNumber).toBe(5); expect(myNumber).toEqual(5); Both of the above tests will …

javascript jasmine
How do I mock a service that returns promise in AngularJS Jasmine unit test?

I have myService that uses myOtherService, which makes a remote call, returning promise: angular.module('app.myService', ['app.myOtherService']) .factory(…

javascript angularjs unit-testing mocking jasmine
Unit testing click event in Angular

I'm trying to add unit tests to my Angular 2 app. In one of my components, there is a button with …

angular typescript jasmine
Angular 2 Unit Tests: Cannot find name 'describe'

I'm following this tutorial from angular.io As they said, I've created hero.spec.ts file to create unit tests: …

unit-testing angular typescript jasmine
How to execute only one test spec with angular-cli

I have Angular2 project build with Angular-CLI (beta 20). Is there a way to run tests against only one selected spec …

angular jasmine angular-cli
How to spyOn a value property (rather than a method) with Jasmine

Jasmine's spyOn is good to change a method's behavior, but is there any way to change a value property (rather …

javascript unit-testing mocking jasmine
How to write unit testing for Angular / TypeScript for private methods with Jasmine

How do you test a private function in angular 2 ? class FooBar { private _status: number; constructor( private foo : Bar ) { this.initFooBar(); } …

angular unit-testing typescript jasmine