0

I have the following observable function:

$scope.$createObservableFunction("getInformation")
                    .debounce(300)
                    .flatMapLatest(function() {
                        return lookupService.getInformation($scope.basicDetails);
                    })
                    .subscribe(function(info) {
                        $scope.info = info;
                    });

I am testing this by running $scope.getInformation(); in each test. I then want to check that the service has been called

it("should call the function retrieving the ABN details and new ABN details assigned", function () {
            expect(lookupService.getInformation).toHaveBeenCalledWith($scope.identity.basicInformation);
        });

This originally worked, but I have now added the debounce method. How can I mock this method using Jasmine 2.0.0? I don't want to use a settimeout/timer based approach

1

1 Answer 1

0

Not really an answer, but I ended up using the timer based approach.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.