如何找到文件调用的路径需要?

发布于 2025-02-04 06:38:37 字数 275 浏览 3 评论 0原文

我有一个大型test_helper文件,其中包括用于单元的代码和集成测试。我想将其分成两部分,而不必更改每个需要“ test_helper”

为此,我想根据测试文件的文件路径调用 nime> unit_test_helper unit_test_helper 基于test文件的文件路径调用需要“ test_helper”

如何找到呼叫的文件路径需要“ test_helper”

I have a large test_helper file which includes code for unit and integration test. I would like to split it into two, without having to change every require "test_helper".

To accomplish that, I want to conditionally call unit_test_helper or integration_test_helper based on the file path of the test file calling require "test_helper".

How can I find the path of the file calling require "test_helper"?

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文