Skip to content

Instantly share code, notes, and snippets.

@kylewelsby
Last active August 29, 2015 13:56
Show Gist options
  • Save kylewelsby/9329246 to your computer and use it in GitHub Desktop.
Save kylewelsby/9329246 to your computer and use it in GitHub Desktop.
var app = angular.module('app',[]);
app.config(function($http){
/* a request we're wanting to stub */
$http.get('/example').then(function(){
// handle example
});
});
describe('app', function (){
var app = angular.module('app-mock', ['ngMock','app']);
app.config(function($httpBackend){
$httpBackend.when('GET', '/example').respond(200, {});
});
beforeEach(module('app-mock'));
it('does something', function(){
expect(true).toBeTruthy();
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment