From 117e40c3190c2be7ebcc503060661b29304ac98b Mon Sep 17 00:00:00 2001 From: Keen Yee Liau Date: Mon, 16 Nov 2020 11:21:00 -0800 Subject: [PATCH] fix: error only when karma is navigating This commit fixes a bug whereby Karma mistakenly errors out when it is *not* navigating. This is because the variable was flipped from `reloadingContext` to `karmaNavigating` in #3565, but the condition was not negated. --- client/karma.js | 2 +- static/karma.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/karma.js b/client/karma.js index ec0db417e..efc48dc30 100644 --- a/client/karma.js +++ b/client/karma.js @@ -131,7 +131,7 @@ function Karma (socket, iframe, opener, navigator, location, document) { } this.onbeforeunload = function () { - if (!karmaNavigating) { + if (karmaNavigating) { // TODO(vojta): show what test (with explanation about jasmine.UPDATE_INTERVAL) self.error('Some of your tests did a full page reload!') } diff --git a/static/karma.js b/static/karma.js index bc3a2bbb6..709610af4 100644 --- a/static/karma.js +++ b/static/karma.js @@ -141,7 +141,7 @@ function Karma (socket, iframe, opener, navigator, location, document) { } this.onbeforeunload = function () { - if (!karmaNavigating) { + if (karmaNavigating) { // TODO(vojta): show what test (with explanation about jasmine.UPDATE_INTERVAL) self.error('Some of your tests did a full page reload!') }