Explorar o código

Add workaround for intermittent test failures

Danilo Bargen %!s(int64=8) %!d(string=hai) anos
pai
achega
e8908eddb6
Modificáronse 4 ficheiros con 9 adicións e 0 borrados
  1. 2 0
      tests/filters.js
  2. 3 0
      tests/helpers.js
  3. 2 0
      tests/qrcode.js
  4. 2 0
      tests/service/message.js

+ 2 - 0
tests/filters.js

@@ -2,6 +2,8 @@ describe('Filters', function() {
 
     let $filter;
 
+    beforeAll(() => window.onbeforeunload = () => 'Ignoring page reload request');
+
     beforeEach(function() {
 
         // Load 3ema.filters module

+ 3 - 0
tests/helpers.js

@@ -1,6 +1,9 @@
 describe('Helpers', function () {
+
     let stringService;
 
+    beforeAll(() => window.onbeforeunload = () => 'Ignoring page reload request');
+
     beforeEach(function () {
             // Load 3ema.services
         module('3ema.services');

+ 2 - 0
tests/qrcode.js

@@ -2,6 +2,8 @@ describe('QrCodeService', function() {
 
     let $service;
 
+    beforeAll(() => window.onbeforeunload = () => 'Ignoring page reload request');
+
     beforeEach(function() {
 
         module(($provide) => {

+ 2 - 0
tests/service/message.js

@@ -2,6 +2,8 @@ describe('MessageService', function() {
 
     let messageService;
 
+    beforeAll(() => window.onbeforeunload = () => 'Ignoring page reload request');
+
     beforeEach(function() {
 
         // load threema services