]> git.proxmox.com Git - mirror_novnc.git/blobdiff - tests/test.helper.js
Make afterEach() hooks work when skipping tests
[mirror_novnc.git] / tests / test.helper.js
index 02328197c2748df1c791a702f85939ab5edb87ba..b1f438ee50f1866ac7a7295a96f99ca89427cc5f 100644 (file)
@@ -86,7 +86,9 @@ describe('Helpers', function () {
                 window.navigator.platform = "Mac x86_64";
             });
             afterEach(function () {
-                Object.defineProperty(window, "navigator", origNavigator);
+                if (origNavigator !== undefined) {
+                    Object.defineProperty(window, "navigator", origNavigator);
+                }
             });
 
             it('should respect ContextMenu on modern browser', function () {
@@ -150,7 +152,9 @@ describe('Helpers', function () {
                 }
             });
             afterEach(function () {
-                Object.defineProperty(window, "navigator", origNavigator);
+                if (origNavigator !== undefined) {
+                    Object.defineProperty(window, "navigator", origNavigator);
+                }
             });
 
             it('should ignore printable character key on IE', function () {