Skip to content

Instantly share code, notes, and snippets.

@zapnap
Created January 17, 2014 19:39
Show Gist options
  • Save zapnap/8480021 to your computer and use it in GitHub Desktop.
Save zapnap/8480021 to your computer and use it in GitHub Desktop.
#= require application
#= require angular-mocks
#= require sinon
#= require jasmine-sinon
beforeEach(module('AngularApp'))
beforeEach inject (_$httpBackend_, _$compile_, $rootScope, $controller, $location, $injector, $timeout) ->
@scope = $rootScope.$new()
@http = _$httpBackend_
@compile = _$compile_
@location = $location
@controller = $controller
@injector = $injector
@timeout = $timeout
@model = (name) =>
@injector.get(name)
@eventLoop =
flush: =>
@scope.$digest()
@sandbox = sinon.sandbox.create()
afterEach ->
@http.resetExpectations()
@http.verifyNoOutstandingExpectation()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment