resolving promise returned from a factory in jasmine #581

jitendrasbhati opened this Issue Apr 28, 2014 · 1 comment


None yet

3 participants



I have designed a factory that contains a method that makes an asynchronous using $http.

I am trying to access promise values returned from factory in jasmine.

I want the returned promise value to be resolve in jasmine.

I need a simple example that would solve this issue

Please help me resolve the issue

The following is the piece of factory code

var app=angular.module('chartApp');

app.controller('chartCtrl', [

    function($scope, $http, scatterplot) {

    method: 'GET',
    url: 'RNASequenceDataServlet',
         headers: { 'Content-Type': 'application/json' },

  .success(function (data, status, headers, config) {


return (deferred.promise);


Please help me wrtitng a test case with proper syntax that will help me resolve this issue

infews commented Jun 23, 2014

Since this is a "how to test" type of question, have you tried the Jasmine Google Group - More of the community gathers there to help people with testing patterns..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment