反应本地开玩笑没有退出,并将实际库作为问题的原因显示

发布于 2025-01-30 08:45:06 字数 493 浏览 4 评论 0原文

IM在现有项目上用库型/反应本机的React本机中实施测试框架(JEST)。 当我运行他们的示例(介绍)时,应用程序会出现臭名昭著的错误:

Jest did not exit one second after the test run has completed.

当我尝试使用标志(detectopenhandles)检查时,它表明库本身就是问题。

我没有开玩笑的配置文件。 RN -66.4 开玩笑-28.1.0 巴别吉斯 - 26.6.3 Jest -Circus -26.6.3 Eslint-Plugin-Jest-26.1.1

Im implementing tests framework (jest) in react native with testing-library/react-native, on an existing project.
When I run their example (intro) the app give the infamous error:

Jest did not exit one second after the test run has completed.

when I try to check it with the flag --detectOpenHandles, it shows that the library itself is the problem.
enter image description here

I have no config file for jest.
RN - 66.4
jest - 28.1.0
babel-jest - 26.6.3
jest-circus - 26.6.3
eslint-plugin-jest - 26.1.1

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

花落人断肠 2025-02-06 08:45:06

我的问题通过此代码解决了:

beforeAll(done => {
  done()
})

afterAll(done => {
  // Closing the DB connection allows Jest to exit successfully.
  mongoose.connection.close()
  done()
})

My problem was solved by this code:

beforeAll(done => {
  done()
})

afterAll(done => {
  // Closing the DB connection allows Jest to exit successfully.
  mongoose.connection.close()
  done()
})
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文