我想使用 ava 来测试我的代码,但是当我尝试它时,我收到以下错误...我认为缺少一个 catch (err)...
(node:7640) UnhandledPromiseRejectionWarning: C:\...\TesBoard-db\node_modules\ava\lib\node-arguments.js:9
} catch {
^
(node:7640) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7640) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
知道如何解决这个问题吗?
提前致谢。
最佳答案
是的,update Node 。 <- 他们在该问题线程中推荐 Node.js 12.15。
为了将来的引用,以及 StackOverflow,当堆栈中存在任何抛出或行为异常的内容时,您需要搜索 GitHub 问题。
关于javascript - 未处理的 promise 拒绝 AVA,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60381954/