From 4a25559a2dbe74738607341cd1dc0d2d71190c7e Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Sun, 11 Oct 2020 19:56:01 -0400 Subject: [PATCH] tests: Aggressively filter out non-.js files This prevents errors when the directory contains Emacs backup files. --- src/node/hooks/express/tests.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/node/hooks/express/tests.js b/src/node/hooks/express/tests.js index 216715d43..cc115b79c 100644 --- a/src/node/hooks/express/tests.js +++ b/src/node/hooks/express/tests.js @@ -13,8 +13,8 @@ exports.expressCreateServer = function (hook_name, args, cb) { // merge the two sets of results let files = [].concat(coreTests, pluginTests).sort(); - // Remove swap files from tests - files = files.filter(el => !/\.swp$/.test(el)) + // Keep only *.js files + files = files.filter((f) => f.endsWith('.js')); console.debug("Sent browser the following test specs:", files); res.setHeader('content-type', 'text/javascript');