AngularJS, Grails

Testing promises with Jasmine

We have been using Jasmine to test our angular code. Recently I came across a piece of code in Javascript which included a REST API call and returned a promise. The promise then had a success callback and all the rest of the play. So in this blog, I have tried to illustrate how to test a promise. Here I have a function which returns a...

by Komal Jain
Tag: jasmine
03-Aug-2015

Node.js, Technology

Custom matcher for testing with Jasmine

Jasmine is a behavior-driven development framework for testing JavaScript code. Many Jasmine users only use the default set of matchers which are extremely powerful, yet are unable to meet our requirements when dealing with complicated or custom code. Jasmine provides a wide list of built-in matchers: Arrays: [javascript] ...

by Mohit Tyagi
Tag: jasmine
08-Jul-2015

Technology

Node.js: Unit Testing with Jasmine framework

Jasmine is a framework which is used for testing node.js code or javascript code. Installation To install the latest official version, use NPM: [js]npm install jasmine-node -g[/js] Write the specifications for your code in *.js and *.coffee files in the spec/ directory Execution After installing the npm package, you can...

by Sahil Chitkara
Tag: jasmine
14-May-2013