opitzconsulting / uitest.js

uitest.js is able to load a webpage into a frame, instrument that page and the javascript in that page (e.g. add additional scripts at the end of the document, ...) and execute actions on that page.
MIT License
67 stars 8 forks source link

E2E backend testing with angular mocks #25

Open a-hahn opened 11 years ago

a-hahn commented 11 years ago

I'm trying to set up e2e backend tests with angular mocks and passThrough() like in this fiddle: http://jsfiddle.net/vojtajina/DQHdk/ there seems to be something wrong with my initialization code in the testSpec.js as #passThrough() is not a valid function in this context.

    uit.append(function(angular) {
        var mod = angular.module("ng");
        mod.config(function($provide) {
            $provide.decorator('$http', ['$delegate', '$httpBackend', function($http, $httpBackend) {
                $httpBackend.whenGET().passThrough();
                return $http;
            }]);
        });
    });

thx Andreas

tbosch commented 11 years ago

Hi, sorry, but won't have time until next week to look at this...

Tobias