Skip to content

Instantly share code, notes, and snippets.

View jasperkuperus's full-sized avatar
💭
😎

Jasper Kuperus jasperkuperus

💭
😎
View GitHub Profile
angular.module('stateMock',[]);
angular.module('stateMock').service("$state", function($q){
this.expectedTransitions = [];
this.transitionTo = function(stateName){
if(this.expectedTransitions.length > 0){
var expectedState = this.expectedTransitions.shift();
if(expectedState !== stateName){
throw Error("Expected transition to state: " + expectedState + " but transitioned to " + stateName );
}
}else{