tests: Use `async`/`await` instead of returning Promises
This makes stack traces more useful.pull/5050/head
parent
0d9476529e
commit
d87b4e0c20
|
@ -87,12 +87,12 @@ exports.getPluginTests = async (callback) => {
|
||||||
const promises = plugins
|
const promises = plugins
|
||||||
.map((plugin) => [plugin, moduleDir + plugin + specPath])
|
.map((plugin) => [plugin, moduleDir + plugin + specPath])
|
||||||
.filter(([plugin, specDir]) => fs.existsSync(specDir)) // check plugin exists
|
.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) => {
|
.then((specFiles) => specFiles.map((spec) => {
|
||||||
pluginSpecs.push(staticDir + plugin + specPath + 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…
Reference in New Issue