From 5dcb7a75498a7326bff312987a65ce02ec880594 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Mon, 14 Jun 2021 04:22:46 -0400 Subject: [PATCH] tests: Don't attempt to wrap non-functions --- src/tests/frontend/runner.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tests/frontend/runner.js b/src/tests/frontend/runner.js index cc9d0315f..449c126c5 100644 --- a/src/tests/frontend/runner.js +++ b/src/tests/frontend/runner.js @@ -221,6 +221,7 @@ $(() => (async () => { // backups might be placeholders, not the actual Mocha functions. const backups = {}; for (const fn of mochaFns) { + if (typeof window[fn] !== 'function') continue; // Note: Test specs can require other modules, so window[fn] might be a placeholder // function, not the actual Mocha function. backups[fn] = window[fn];