tests: Use `async`/`await` instead of returning Promises

This makes stack traces more useful.
pull/5050/head
Richard Hansen 2021-05-09 16:23:49 -04:00
parent 0d9476529e
commit d87b4e0c20
1 changed files with 3 additions and 3 deletions

View File

@ -87,12 +87,12 @@ exports.getPluginTests = async (callback) => {
const promises = plugins
.map((plugin) => [plugin, moduleDir + plugin + specPath])
.filter(([plugin, specDir]) => fs.existsSync(specDir)) // check plugin exists
.map(([plugin, specDir]) => readdir(specDir)
.map(async ([plugin, specDir]) => await readdir(specDir)
.then((specFiles) => specFiles.map((spec) => {
pluginSpecs.push(staticDir + plugin + specPath + spec);
})));
return Promise.all(promises).then(() => pluginSpecs);
return await Promise.all(promises).then(() => pluginSpecs);
};
exports.getCoreTests = () => readdir('src/tests/frontend/specs');
exports.getCoreTests = async () => await readdir('src/tests/frontend/specs');