tests: Aggressively filter out non-.js files

This prevents errors when the directory contains Emacs backup files.
pull/4415/head
Richard Hansen 2020-10-11 19:56:01 -04:00 committed by John McLear
parent 7f79d201e6
commit 4a25559a2d
1 changed files with 2 additions and 2 deletions

View File

@ -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');