Injected $stateParams and $state into jasmine angular js test getting undefined

后端 未结 2 707
青春惊慌失措
青春惊慌失措 2020-12-16 05:09

I am writing a jasmine test for my DetailCtrl. I have 10 json file each with file names like this

1.json
2.json
3.json

in my data folder

2条回答
  •  庸人自扰
    2020-12-16 06:12

    Adding the stateMock.js and then including the module

    beforeEach(function() {
        module('stateMock');
        module('mean');
        module('mean.system');
        module('mean.companies');
      });
    

    code here for stackMock.js: github code for stateMock

    Reference: UI-router interfers with $httpbackend unit test, angular js.

提交回复
热议问题