Unexpected request: GET followed by [$rootScope:inprog] $digest already in progress. Angularjs and KarmaAngularJS : Prevent error $digest already in progress when calling $scope.$apply()Unit testing AngularJS routes throwing Error: Unexpected requestAngularJS testing with $httpBackend - Service is not calledtesting angularjs $httpbackend and $resourceNo pending request to flush on using whenGET, but not expectGET$scope.$apply undefined angularJS unit testing jasmineTimeout on angular service test using $q and angular-extended-promisesJasmine test error on Jenkins Build Server with angular-mocks?Angular JS : Error: Unexpected request: GET templates/login.htmlvariables in the controller are not defined. karma and angularjs
Which Article Helped Get Rid of Technobabble in RPGs?
"It doesn't matter" or "it won't matter"?
Has any country ever had 2 former presidents in jail simultaneously?
What's the name of the logical fallacy where a debater extends a statement far beyond the original statement to make it true?
Is there any evidence that Cleopatra and Caesarion considered fleeing to India to escape the Romans?
How do I fix the group tension caused by my character stealing and possibly killing without provocation?
awk assign to multiple variables at once
Merge org tables
Does the reader need to like the PoV character?
Why does AES have exactly 10 rounds for a 128-bit key, 12 for 192 bits and 14 for a 256-bit key size?
Do we have to expect a queue for the shuttle from Watford Junction to Harry Potter Studio?
Will number of steps recorded on FitBit/any fitness tracker add up distance in PokemonGo?
Why the "ls" command is showing the permissions of files in a FAT32 partition?
Is there a nicer/politer/more positive alternative for "negates"?
The Digit Triangles
Which was the first story featuring espers?
Make a Bowl of Alphabet Soup
Stack Interview Code methods made from class Node and Smart Pointers
Why Shazam when there is already Superman?
Quoting Keynes in a lecture
Can I say "fingers" when referring to toes?
Change the color of a single dot in `ddot` symbol
Creating two special characters
Does grappling negate Mirror Image?
Unexpected request: GET followed by [$rootScope:inprog] $digest already in progress. Angularjs and Karma
AngularJS : Prevent error $digest already in progress when calling $scope.$apply()Unit testing AngularJS routes throwing Error: Unexpected requestAngularJS testing with $httpBackend - Service is not calledtesting angularjs $httpbackend and $resourceNo pending request to flush on using whenGET, but not expectGET$scope.$apply undefined angularJS unit testing jasmineTimeout on angular service test using $q and angular-extended-promisesJasmine test error on Jenkins Build Server with angular-mocks?Angular JS : Error: Unexpected request: GET templates/login.htmlvariables in the controller are not defined. karma and angularjs
spec file
'use strict';
describe('component test : home', function ()
// add module reference you want to test
beforeEach(module('homeView'));
// add templates [from karma]
beforeEach(module('templates'));
var element;
var scope;
var $httpBackend;
beforeEach(inject(function ($rootScope, $compile, _$httpBackend_)
$httpBackend = _$httpBackend_;
scope = $rootScope.$new();
element = angular.element('<home-view></home-view>');
scope.$apply(function ()
$compile(element)(scope);
);
));
it('extra column http get', function ()
var mockResponse =
data:
success: true,
message: ':D :D'
;
$httpBackend.expectGET('http://localhost:51275/api/ExtraColumn')
.respond(mockResponse);
expect(data).toEqual(mockResponse);
$httpBackend.flush();
);
//it('header text', function ()
// var title = element.find('h1');
// console.log(title.text());
// expect(title.text()).toContain('Interviewees');
//);
);
error
Error: Unexpected request: GET http://localhost:51275/api/ExtraColumn
No more request expected
at createFatalError (Scripts/angular-mocks.js:1569:19)
at $httpBackend (Scripts/angular-mocks.js:1616:11)
at sendReq (Scripts/angular.js:13257:9)
at serverRequest (Scripts/angular.js:12998:16)
at processQueue (Scripts/angular.js:17914:37)
at Scripts/angular.js:17962:27
at Scope.$digest (Scripts/angular.js:19075:15)
at ChildScope.$apply (Scripts/angular.js:19463:24)
at UserContext.<anonymous> (home-view/home-view.component.spec.js:19:15)
at Object.invoke (Scripts/angular.js:5122:19)
at <Jasmine>
at window.inject.angular.mock.inject (Scripts/angular-mocks.js:3422:25)
at Suite.<anonymous> (home-view/home-view.component.spec.js:15:16)
at <Jasmine>
at home-view/home-view.component.spec.js:3:1
ReferenceError: data is not defined
at <Jasmine>
at UserContext.<anonymous> (home-view/home-view.component.spec.js:36:16)
at <Jasmine>
I am trying to write tests for my angularjs application. The test needs to mock a http request an I wrote this one above and got these error. unexpected get and $digest already in progress errors when I do not even have a $digest in my code. How do I fix this please tell me.
angularjs
add a comment |
spec file
'use strict';
describe('component test : home', function ()
// add module reference you want to test
beforeEach(module('homeView'));
// add templates [from karma]
beforeEach(module('templates'));
var element;
var scope;
var $httpBackend;
beforeEach(inject(function ($rootScope, $compile, _$httpBackend_)
$httpBackend = _$httpBackend_;
scope = $rootScope.$new();
element = angular.element('<home-view></home-view>');
scope.$apply(function ()
$compile(element)(scope);
);
));
it('extra column http get', function ()
var mockResponse =
data:
success: true,
message: ':D :D'
;
$httpBackend.expectGET('http://localhost:51275/api/ExtraColumn')
.respond(mockResponse);
expect(data).toEqual(mockResponse);
$httpBackend.flush();
);
//it('header text', function ()
// var title = element.find('h1');
// console.log(title.text());
// expect(title.text()).toContain('Interviewees');
//);
);
error
Error: Unexpected request: GET http://localhost:51275/api/ExtraColumn
No more request expected
at createFatalError (Scripts/angular-mocks.js:1569:19)
at $httpBackend (Scripts/angular-mocks.js:1616:11)
at sendReq (Scripts/angular.js:13257:9)
at serverRequest (Scripts/angular.js:12998:16)
at processQueue (Scripts/angular.js:17914:37)
at Scripts/angular.js:17962:27
at Scope.$digest (Scripts/angular.js:19075:15)
at ChildScope.$apply (Scripts/angular.js:19463:24)
at UserContext.<anonymous> (home-view/home-view.component.spec.js:19:15)
at Object.invoke (Scripts/angular.js:5122:19)
at <Jasmine>
at window.inject.angular.mock.inject (Scripts/angular-mocks.js:3422:25)
at Suite.<anonymous> (home-view/home-view.component.spec.js:15:16)
at <Jasmine>
at home-view/home-view.component.spec.js:3:1
ReferenceError: data is not defined
at <Jasmine>
at UserContext.<anonymous> (home-view/home-view.component.spec.js:36:16)
at <Jasmine>
I am trying to write tests for my angularjs application. The test needs to mock a http request an I wrote this one above and got these error. unexpected get and $digest already in progress errors when I do not even have a $digest in my code. How do I fix this please tell me.
angularjs
add a comment |
spec file
'use strict';
describe('component test : home', function ()
// add module reference you want to test
beforeEach(module('homeView'));
// add templates [from karma]
beforeEach(module('templates'));
var element;
var scope;
var $httpBackend;
beforeEach(inject(function ($rootScope, $compile, _$httpBackend_)
$httpBackend = _$httpBackend_;
scope = $rootScope.$new();
element = angular.element('<home-view></home-view>');
scope.$apply(function ()
$compile(element)(scope);
);
));
it('extra column http get', function ()
var mockResponse =
data:
success: true,
message: ':D :D'
;
$httpBackend.expectGET('http://localhost:51275/api/ExtraColumn')
.respond(mockResponse);
expect(data).toEqual(mockResponse);
$httpBackend.flush();
);
//it('header text', function ()
// var title = element.find('h1');
// console.log(title.text());
// expect(title.text()).toContain('Interviewees');
//);
);
error
Error: Unexpected request: GET http://localhost:51275/api/ExtraColumn
No more request expected
at createFatalError (Scripts/angular-mocks.js:1569:19)
at $httpBackend (Scripts/angular-mocks.js:1616:11)
at sendReq (Scripts/angular.js:13257:9)
at serverRequest (Scripts/angular.js:12998:16)
at processQueue (Scripts/angular.js:17914:37)
at Scripts/angular.js:17962:27
at Scope.$digest (Scripts/angular.js:19075:15)
at ChildScope.$apply (Scripts/angular.js:19463:24)
at UserContext.<anonymous> (home-view/home-view.component.spec.js:19:15)
at Object.invoke (Scripts/angular.js:5122:19)
at <Jasmine>
at window.inject.angular.mock.inject (Scripts/angular-mocks.js:3422:25)
at Suite.<anonymous> (home-view/home-view.component.spec.js:15:16)
at <Jasmine>
at home-view/home-view.component.spec.js:3:1
ReferenceError: data is not defined
at <Jasmine>
at UserContext.<anonymous> (home-view/home-view.component.spec.js:36:16)
at <Jasmine>
I am trying to write tests for my angularjs application. The test needs to mock a http request an I wrote this one above and got these error. unexpected get and $digest already in progress errors when I do not even have a $digest in my code. How do I fix this please tell me.
angularjs
spec file
'use strict';
describe('component test : home', function ()
// add module reference you want to test
beforeEach(module('homeView'));
// add templates [from karma]
beforeEach(module('templates'));
var element;
var scope;
var $httpBackend;
beforeEach(inject(function ($rootScope, $compile, _$httpBackend_)
$httpBackend = _$httpBackend_;
scope = $rootScope.$new();
element = angular.element('<home-view></home-view>');
scope.$apply(function ()
$compile(element)(scope);
);
));
it('extra column http get', function ()
var mockResponse =
data:
success: true,
message: ':D :D'
;
$httpBackend.expectGET('http://localhost:51275/api/ExtraColumn')
.respond(mockResponse);
expect(data).toEqual(mockResponse);
$httpBackend.flush();
);
//it('header text', function ()
// var title = element.find('h1');
// console.log(title.text());
// expect(title.text()).toContain('Interviewees');
//);
);
error
Error: Unexpected request: GET http://localhost:51275/api/ExtraColumn
No more request expected
at createFatalError (Scripts/angular-mocks.js:1569:19)
at $httpBackend (Scripts/angular-mocks.js:1616:11)
at sendReq (Scripts/angular.js:13257:9)
at serverRequest (Scripts/angular.js:12998:16)
at processQueue (Scripts/angular.js:17914:37)
at Scripts/angular.js:17962:27
at Scope.$digest (Scripts/angular.js:19075:15)
at ChildScope.$apply (Scripts/angular.js:19463:24)
at UserContext.<anonymous> (home-view/home-view.component.spec.js:19:15)
at Object.invoke (Scripts/angular.js:5122:19)
at <Jasmine>
at window.inject.angular.mock.inject (Scripts/angular-mocks.js:3422:25)
at Suite.<anonymous> (home-view/home-view.component.spec.js:15:16)
at <Jasmine>
at home-view/home-view.component.spec.js:3:1
ReferenceError: data is not defined
at <Jasmine>
at UserContext.<anonymous> (home-view/home-view.component.spec.js:36:16)
at <Jasmine>
I am trying to write tests for my angularjs application. The test needs to mock a http request an I wrote this one above and got these error. unexpected get and $digest already in progress errors when I do not even have a $digest in my code. How do I fix this please tell me.
angularjs
angularjs
edited Feb 28 at 17:37
Vivz
6,06721229
6,06721229
asked Feb 28 at 17:00
ThunfischeThunfische
3251418
3251418
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
At any point in time there can be only one $digest or $apply operation in progress. This is to prevent very hard to detect bugs from entering your application. The stack trace of this error allows you to trace the origin of the currently executing $apply or $digest call, which caused the error.
please refer this link
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54930742%2funexpected-request-get-followed-by-rootscopeinprog-digest-already-in-progr%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
At any point in time there can be only one $digest or $apply operation in progress. This is to prevent very hard to detect bugs from entering your application. The stack trace of this error allows you to trace the origin of the currently executing $apply or $digest call, which caused the error.
please refer this link
add a comment |
At any point in time there can be only one $digest or $apply operation in progress. This is to prevent very hard to detect bugs from entering your application. The stack trace of this error allows you to trace the origin of the currently executing $apply or $digest call, which caused the error.
please refer this link
add a comment |
At any point in time there can be only one $digest or $apply operation in progress. This is to prevent very hard to detect bugs from entering your application. The stack trace of this error allows you to trace the origin of the currently executing $apply or $digest call, which caused the error.
please refer this link
At any point in time there can be only one $digest or $apply operation in progress. This is to prevent very hard to detect bugs from entering your application. The stack trace of this error allows you to trace the origin of the currently executing $apply or $digest call, which caused the error.
please refer this link
edited Mar 7 at 4:28
gameon67
819823
819823
answered Mar 1 at 6:48
Shriram SalunkheShriram Salunkhe
15
15
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54930742%2funexpected-request-get-followed-by-rootscopeinprog-digest-already-in-progr%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown