Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

ui-router not working while unit testing #29

Open
doshimehul opened this issue Apr 28, 2014 · 0 comments
Open

ui-router not working while unit testing #29

doshimehul opened this issue Apr 28, 2014 · 0 comments

Comments

@doshimehul
Copy link

Hi Thanks for the seed project. I have setup a project basedon the steps and it works great!

However I am facing issue while trying to setup unit test case with ui-router.

var module = angular.module('moduleAddonControllers', []);
module.controller('TestaddonAddCtrl',['$scope','$state', function ($scope,$parse) {

$scope.mode = "add";
$state.go();

}
]);

When controller is having reference of '$state' my unit test case if failing with following error message!
"Error: [$injector:unpr] Unknown provider: $stateProvider <- $state"

My guess is *Spec.js are included before the ui-router causing the above issue. Kindly let me know how we can get around this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant