tests: Don't attempt to wrap non-functions

This commit is contained in:
Richard Hansen 2021-06-14 04:22:46 -04:00 committed by webzwo0i
parent 081b97c41d
commit 5dcb7a7549

View file

@ -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];