Closed MrOrz closed 2 weeks ago
In previous PR #338 we added await to yargs in blockUser script. This is causing the following error when script is being executed:
await
yargs
blockUser
nodejs SyntaxError: await is only valid in async functions and the top level bodies of modules
The type of yargs is somehow Sth | Promise<Sth> hence the await. We try to use Promise.resolve().then() to tackle this.
Sth | Promise<Sth>
Promise.resolve().then()
coverage: 83.371%. remained the same when pulling 8d9cd48a9ff16d76689245c29361db2eec4da132 on fix-blockuser-script into 25f2df4284a8149ba98dd122f8b02d1741bdaae7 on master.
In previous PR #338 we added
await
toyargs
inblockUser
script. This is causing the following error when script is being executed:The type of
yargs
is somehowSth | Promise<Sth>
hence theawait
. We try to usePromise.resolve().then()
to tackle this.