首页 > 解决方案 > 测试库 React-Native - 我尝试调试时不会发生内存泄漏

问题描述

因此,我正在尝试为使用 react-navigation 和 relay modern 的 React-Native 组件编写测试。我收到此警告:

A worker process has failed to exit gracefully and has been force exited. This is likely caused by tests leaking due to improper teardown. Try running with --runInBand --detectOpenHandles to find leaks.

当我评论它时,我在测试中找到了确切的行,警告消失了:

    fireEvent.changeText(emailInput, expectedEmail);

问题是当我添加--runInBand --detectOpenHandles到我的测试命令时,警告不再发生。非常感谢任何建议。

标签: react-nativereact-native-testing-library

解决方案


推荐阅读