tests: Delete unnecessary `staticDir` variable

pull/5050/head
Richard Hansen 2021-05-09 16:53:16 -04:00
parent d69345bb4e
commit 1516bf473f
1 changed files with 1 additions and 2 deletions

View File

@ -56,13 +56,12 @@ exports.expressCreateServer = (hookName, args, cb) => {
const getPluginTests = async (callback) => { const getPluginTests = async (callback) => {
const moduleDir = 'node_modules/'; const moduleDir = 'node_modules/';
const specPath = '/static/tests/frontend/specs/'; const specPath = '/static/tests/frontend/specs/';
const staticDir = '/static/plugins/';
const plugins = await fsp.readdir(moduleDir); const plugins = await fsp.readdir(moduleDir);
const specLists = await Promise.all(plugins.map(async (plugin) => { const specLists = await Promise.all(plugins.map(async (plugin) => {
const specDir = moduleDir + plugin + specPath; const specDir = moduleDir + plugin + specPath;
if (!fs.existsSync(specDir)) return []; if (!fs.existsSync(specDir)) return [];
const specFiles = await fsp.readdir(specDir); const specFiles = await fsp.readdir(specDir);
return specFiles.map((spec) => staticDir + plugin + specPath + spec); return specFiles.map((spec) => `/static/plugins/${plugin}${specPath}${spec}`);
})); }));
return [].concat(...specLists); return [].concat(...specLists);
}; };