-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify "Some of your tests did a full page reload!" #1101
Comments
👍 |
+1 please |
+1 |
This is not so simple, I think.
How described in comment more helpful will be have name of test which cause reload. Thanks! |
+1, even the test would be great! |
+100000^100000 this is turning me crazy. |
+1 - I have over 1700 tests that run on a very large app. Since the error doesn't say which test did the reload, or what line of code caused the reload, I'm going to have to go through all of my spec files and ddescribe every file until I find the file that's causing the problem. Once there I'll have to iit every test until I find the culprit. It would be much better if Karma could just say which test name caused the problem, or even go so far as to show the line in the code. |
@maksimr would calling |
+1. It would help if Karma could tell which test case did a full page reload. |
+1 please |
+1. I am encountering this on unit tests that are never injecting the It is very rare and I cannot reproduce consistently unfortunately. More info in the error would really help out. |
@trov-codystebbins To work around, I exit from karma and run again. Always get rid of the message with no further action. but anoying... :( |
+1 |
Hi I am facing the same issue , at one place I have window.location.href in my code (when I do not find something stored in the cookie , I redirect it to some page) , but it has nothing to do with my test cases. And I am getting this error. Any help plzzz? |
Is this being fixed? I'm also having the error even though I do not reload the page in my unit tests (I do have window.location.replace(URL) in my application.) Any help? |
+1 |
I'm also experiencing this behaviour and I'm quite sure I have no reloads on my tests. I don't know if this could be the problem but I'm using webpack and babel alongside karma. When I change any spec file I always get the full page reload error, but all other files are ok (I mean, Karma detects the changes and run the tests again without any reload). I have to constantly restart karma which is really not productive... Any ideas? |
+1 |
+1 |
I've gotten this error on every change to one simple test https://github.com/rackt/react-router/blob/master/package.json#L41 |
+1 |
+1 |
+1 |
1 similar comment
+1 |
I was on the same issue. Then I removed the window event "beforeunload" and everything is running just fine now... |
@VictorQueiroz I tried removing all of our beforeunload handling but am still seeing the issue. Then again, I guess this ticket is less about preventing the issue and more about being specific about where it's coming from anyway. Thanks for the suggestion, anyway. |
+1 does someone know the problem |
@haibei-victor-wu, try to reduce the number of describe sections. |
I hope this helps someone, you can track down causes of this issue with the following steps.
console.profile('cause of reload');
window.addEventListener('beforeunload', function() {
console.profileEnd('cause of reload');
debugger;
});
|
+1 this is so painful atm |
I fought the same issue for some time. I came up with the following solution. I your tests, before you inject anything, create a $window object and use $provide.value() to override the built-in $window object, like this: beforeEach(function () {
module('app');
$window = {location: {reload: sinon.spy()}};
module(function($provide) {
$provide.value('$window', $window);
});
inject(function (...) {...} )
}); Instead of I hope this can help someone else. |
+1 |
Can someone confirm my thinking on this in this PR: #1648 This should at least address the issue of page reloads happening when a user isn't even messing with the location within a spec or dependency. Refer to SHA: 471e3a8 for initial implementation of 'reloadingContext' flag and this stackoverflow post: http://stackoverflow.com/questions/29352578/some-of-your-tests-did-a-full-page-reload-error-when-running-jasmine-tests |
To anyone who is getting this issue lately when your specs don't even mess with the location, it seems to be an issue with jasmine-core... refer to these issues: Refer to jasmine/jasmine#366 and jasmine/jasmine#945 |
Any updates on this issue ? or workaround ? Jasmine issues are still open and the problem is still happening in karma 0.13.14. |
+1 |
Better error message will provided much more value. |
Maybe I misunderstand @timasjov, but isn't |
Avoid karma v0.13.15, which has a bug that prevents our new integration tests from running correctly on Chrome. (See karma-runner/karma#1101) Change-Id: Ia81410b1184ddca3a703d71cd923d4ec0ae5eefc
+1 |
3 similar comments
+1 |
+1 |
+1 |
Please refrain from +1 this issue, I know it's important but there is no straightforward way to actually fix this in karma, as the architecture currently does not allow for this. |
+1 |
If I'm debugging some hairy code I sometimes see this error. It would be really helpful if Karma said what URL my tests tried to navigate to.
The text was updated successfully, but these errors were encountered: