From 1be1b704f161b5627e681a62590c9ebd016a2b7c Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 22 Apr 2021 01:10:19 -0400 Subject: [PATCH] tests: Simplify iteration over frontend test specs --- src/tests/frontend/runner.js | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/tests/frontend/runner.js b/src/tests/frontend/runner.js index 7389c13ee..31fb6d241 100644 --- a/src/tests/frontend/runner.js +++ b/src/tests/frontend/runner.js @@ -138,24 +138,15 @@ $(() => { const getURLParameter = (name) => (new URLSearchParams(location.search)).get(name); - // get the list of specs and filter it if requested - const specs = specs_list.slice(); - const absUrl = (url) => new URL(url, window.location.href).href; require.setRootURI(absUrl('../../javascripts/src')); require.setLibraryURI(absUrl('../../javascripts/lib')); require.setGlobalKeyPath('require'); - // inject spec scripts into the dom const $body = $('body'); - $.each(specs, (i, spec) => { - // if the spec isn't a plugin spec which means the spec file might be in a different subfolder - if (!spec.startsWith('/')) { - $body.append(``); - } else { - $body.append(``); - } - }); + for (const spec of specs_list.map((spec) => encodeURI(spec))) { + $body.append($('