【发布时间】:2022-11-09 15:56:03
【问题描述】:
我正在针对数据库编写一系列测试。所有测试都采用以下形式:
test("Name", async ()=>{
// I do not call done(). I didn't think I had to anymore,
// and I get type errors if I do.
});
不幸的是,这会导致并发问题。我不确定这是否取决于数据库上的后台任务,或者 Jest 同时运行测试。单独运行时测试工作正常,所以我知道某种并发是问题所在。
我怎样才能绝对确保 Jest 一次运行这些异步测试?
【问题讨论】:
标签: asynchronous jestjs ts-jest