-
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
'Some of your tests did a full page reload!' error between two executions since karma 5.2.0 #3560
'Some of your tests did a full page reload!' error between two executions since karma 5.2.0 #3560
Comments
The error message is emitted by an beforeunload event handler: Line 129 in 8bc5b46
Run the test with --no-single-run and open chrome devtools. Set a breakpoint on the handler above and reproduce. You should see the action that causes your issue. |
@johnjbarton I don't think there is any issue in my code (which, BTW, isn't even my code, but the standard code generated by Angular CLI). Even if I reduce the test to the following:
, any change made to the test causes the error to be displayed between the two executions. And the error message is not dispayed when using a version older than 5.2.0, so I think it's a regression. Here's the stack trace when I put the breakpoint where you asked:
|
Please try setting
Is this specific to Angular or just karma file-watch feature? |
It's still good to know though, because my actual project uses a headless browser anyway.
It's not specific to Angular. As soon as |
I'm pretty sure it's a regression. We can see it clearly in Stryker, where we rerun the karma instance in fast succession. I see this line is removed in #3452 : // if not clearing context, reloadingContext always true to prevent beforeUnload error
reloadingContext = !self.config.clearContext If I add that line back Karma works again as expected. @johnjbarton did you deliberately remove this? Or got it lost in translation? |
@nicojs I think something else must be going on here.
will prevent the onbeforeunload error message in all cases if |
Change the flag name to karmaNavigating and set it along all paths where karma deliberately navigates. Other paths must be wrong. Fixes karma-runner#3560
Change the flag name to karmaNavigating and set it along all paths where karma deliberately navigates. Other paths must be wrong. Fixes karma-runner#3560
Change the flag name to karmaNavigating and set it along all paths where karma deliberately navigates. Other paths must be wrong. Fixes karma-runner#3560
Change the flag name to karmaNavigating and set it along all paths where karma deliberately navigates. Other paths must be wrong. Fixes karma-runner#3560
Change the flag name to karmaNavigating and set it along all paths where karma deliberately navigates. Other paths must be wrong. Fixes karma-runner#3560
Change the flag name to karmaNavigating and set it along all paths where karma deliberately navigates. Other paths must be wrong. Fixes karma-runner#3560
Change the flag name to karmaNavigating and set it along all paths where karma deliberately navigates. Other paths must be wrong. Fixes karma-runner#3560
Change the flag name to karmaNavigating and set it along all paths where karma deliberately navigates. Other paths must be wrong. Fixes #3560
Thanks for the fix @johnjbarton |
…5.2.0 This commit downgrades `karma` to version 5.1.1, because of a regression in version 5.2.0: karma-runner/karma#3560 It has been fixed with karma-runner/karma@05dc28801627e3ce7054 on master, but the fix is not included in the latest release (v5.2.3).
…5.2.0 This commit downgrades `karma` to version 5.1.1, because of a regression in version 5.2.0: karma-runner/karma#3560 It has been fixed with karma-runner/karma@05dc28801627e3ce7054 on master, but the fix is not included in the latest release (v5.2.3).
…5.2.0 This commit downgrades `karma` to version 5.1.1, because of a regression in version 5.2.0: karma-runner/karma#3560 It has been fixed with karma-runner/karma@05dc28801627e3ce7054 on master, but the fix is not included in the latest release (v5.2.3).
…5.2.0 This commit downgrades `karma` to version 5.1.1, because of a regression in version 5.2.0: karma-runner/karma#3560 It has been fixed with karma-runner/karma@05dc28801627e3ce7054 on master, but the fix is not included in the latest release (v5.2.3).
…5.2.0 This commit downgrades `karma` to version 5.1.1, because of a regression in version 5.2.0: karma-runner/karma#3560 It has been fixed with karma-runner/karma@05dc28801627e3ce7054 on master, but the fix is not included in the latest release (v5.2.3).
…5.2.0 This commit downgrades `karma` to version 5.1.1, because of a regression in version 5.2.0: karma-runner/karma#3560 It has been fixed with karma-runner/karma@05dc28801627e3ce7054 on master, but the fix is not included in the latest release (v5.2.3).
…5.2.0 (#39600) This commit downgrades `karma` to version 5.1.1, because of a regression in version 5.2.0: karma-runner/karma#3560 It has been fixed with karma-runner/karma@05dc28801627e3ce7054 on master, but the fix is not included in the latest release (v5.2.3). PR Close #39600
…5.2.0 (#39600) This commit downgrades `karma` to version 5.1.1, because of a regression in version 5.2.0: karma-runner/karma#3560 It has been fixed with karma-runner/karma@05dc28801627e3ce7054 on master, but the fix is not included in the latest release (v5.2.3). PR Close #39600
@johnjbarton this fix still seems unreleased. Could we release this? Stryker users are reporting issues. |
We are working on a release now |
# [6.0.0](v5.2.3...v6.0.0) (2021-01-13) ### Bug Fixes * **ci:** abandon browserstack tests for Safari and IE ([#3615](#3615)) ([04a811d](04a811d)) * **client:** do not reset karmaNavigating in unload handler ([#3591](#3591)) ([4a8178f](4a8178f)), closes [#3482](#3482) * **context:** do not error when karma is navigating ([#3565](#3565)) ([05dc288](05dc288)), closes [#3560](#3560) * **cve:** update ua-parser-js to 0.7.23 to fix CVE-2020-7793 ([#3584](#3584)) ([f819fa8](f819fa8)) * **cve:** update yargs to 16.1.1 to fix cve-2020-7774 in y18n ([#3578](#3578)) ([3fed0bc](3fed0bc)), closes [#3577](#3577) * **deps:** bump socket-io to v3 ([#3586](#3586)) ([1b9e1de](1b9e1de)), closes [#3569](#3569) * **middleware:** catch errors when loading a module ([#3605](#3605)) ([fec972f](fec972f)), closes [#3572](#3572) * **server:** clean up close-server logic ([#3607](#3607)) ([3fca456](3fca456)) * **test:** clear up clearContext ([#3597](#3597)) ([8997b74](8997b74)) * **test:** mark all second connections reconnects ([#3598](#3598)) ([1c9c2de](1c9c2de)) ### Features * **cli:** error out on unexpected options or parameters ([#3589](#3589)) ([603bbc0](603bbc0)) * **client:** update banner with connection, test status, ping times ([#3611](#3611)) ([4bf90f7](4bf90f7)) * **server:** print stack of unhandledrejections ([#3593](#3593)) ([35a5842](35a5842)) * **server:** remove deprecated static methods ([#3595](#3595)) ([1a65bf1](1a65bf1)) * remove support for running dart code in the browser ([#3592](#3592)) ([7a3bd55](7a3bd55)) ### BREAKING CHANGES * **server:** Deprecated `require('karma').server.start()` and `require('karma').Server.start()` variants were removed from the public API. Instead use canonical form: ``` const { Server } = require('karma'); const server = new Server(); server.start(); ``` * **cli:** Karma is more strict and will error out if unknown option or argument is passed to CLI. * Using Karma to run Dart code in the browser is no longer supported. Use your favorite Dart-to-JS compiler instead. `dart` file type has been removed without a replacement. `customFileHandlers` DI token has been removed. Use [`middleware`](http://karma-runner.github.io/5.2/config/configuration-file.html#middleware) to achieve similar functionality. `customScriptTypes` DI token has been removed. It had no effect, so no replacement is provided. * **deps:** Some projects have socket.io tests that are version sensitive.
🎉 This issue has been resolved in version 6.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Change the flag name to karmaNavigating and set it along all paths where karma deliberately navigates. Other paths must be wrong. Fixes karma-runner#3560
# [6.0.0](karma-runner/karma@v5.2.3...v6.0.0) (2021-01-13) ### Bug Fixes * **ci:** abandon browserstack tests for Safari and IE ([karma-runner#3615](karma-runner#3615)) ([04a811d](karma-runner@04a811d)) * **client:** do not reset karmaNavigating in unload handler ([karma-runner#3591](karma-runner#3591)) ([4a8178f](karma-runner@4a8178f)), closes [karma-runner#3482](karma-runner#3482) * **context:** do not error when karma is navigating ([karma-runner#3565](karma-runner#3565)) ([05dc288](karma-runner@05dc288)), closes [karma-runner#3560](karma-runner#3560) * **cve:** update ua-parser-js to 0.7.23 to fix CVE-2020-7793 ([karma-runner#3584](karma-runner#3584)) ([f819fa8](karma-runner@f819fa8)) * **cve:** update yargs to 16.1.1 to fix cve-2020-7774 in y18n ([karma-runner#3578](karma-runner#3578)) ([3fed0bc](karma-runner@3fed0bc)), closes [karma-runner#3577](karma-runner#3577) * **deps:** bump socket-io to v3 ([karma-runner#3586](karma-runner#3586)) ([1b9e1de](karma-runner@1b9e1de)), closes [karma-runner#3569](karma-runner#3569) * **middleware:** catch errors when loading a module ([karma-runner#3605](karma-runner#3605)) ([fec972f](karma-runner@fec972f)), closes [karma-runner#3572](karma-runner#3572) * **server:** clean up close-server logic ([karma-runner#3607](karma-runner#3607)) ([3fca456](karma-runner@3fca456)) * **test:** clear up clearContext ([karma-runner#3597](karma-runner#3597)) ([8997b74](karma-runner@8997b74)) * **test:** mark all second connections reconnects ([karma-runner#3598](karma-runner#3598)) ([1c9c2de](karma-runner@1c9c2de)) ### Features * **cli:** error out on unexpected options or parameters ([karma-runner#3589](karma-runner#3589)) ([603bbc0](karma-runner@603bbc0)) * **client:** update banner with connection, test status, ping times ([karma-runner#3611](karma-runner#3611)) ([4bf90f7](karma-runner@4bf90f7)) * **server:** print stack of unhandledrejections ([karma-runner#3593](karma-runner#3593)) ([35a5842](karma-runner@35a5842)) * **server:** remove deprecated static methods ([karma-runner#3595](karma-runner#3595)) ([1a65bf1](karma-runner@1a65bf1)) * remove support for running dart code in the browser ([karma-runner#3592](karma-runner#3592)) ([7a3bd55](karma-runner@7a3bd55)) ### BREAKING CHANGES * **server:** Deprecated `require('karma').server.start()` and `require('karma').Server.start()` variants were removed from the public API. Instead use canonical form: ``` const { Server } = require('karma'); const server = new Server(); server.start(); ``` * **cli:** Karma is more strict and will error out if unknown option or argument is passed to CLI. * Using Karma to run Dart code in the browser is no longer supported. Use your favorite Dart-to-JS compiler instead. `dart` file type has been removed without a replacement. `customFileHandlers` DI token has been removed. Use [`middleware`](http://karma-runner.github.io/5.2/config/configuration-file.html#middleware) to achieve similar functionality. `customScriptTypes` DI token has been removed. It had no effect, so no replacement is provided. * **deps:** Some projects have socket.io tests that are version sensitive.
Seems to fix:
|
When i use |
Since version 5.2.0, in watch mode, every time an Angular test suite re-executes after some change is saved in a file, I get the following log in the console:
The tests run fine and pass, but this error is logged between executions.
Here's a reproduction project: https://github.com/jnizet/karmarepro
To reproduce:
Note that this project has just been created by
ng new
to create a new Angular projectSo I doubt the tests actually do a full page reload as the error message claims.
The text was updated successfully, but these errors were encountered: