mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-24 01:16:15 -04:00
tests: Use async
/await
instead of returning Promises
This makes stack traces more useful.
This commit is contained in:
parent
0d9476529e
commit
d87b4e0c20
1 changed files with 3 additions and 3 deletions
|
@ -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');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue