How to export function from module without nodeunit testing it?
- 主要语言
- JavaScript
- 星标
- 1.9k
- 派生
- 359
- PR 合并指标
- 30 天内没有已合并 PR
描述
I've got a few tests scattered throughout multiple files.
Currently I just run `nodeunit .`, nodeunit then tests them all successfully. Great!
But I want to export a function from one of my files so that another can call it. The problem is that when I run `nodeunit .` that function now gets called.
How can I run tests on all files? I'm used to python's `nose` library, which only tests functions that have `test` in the function name.
Do I need to move all tests into a seperate file to the functionality? I don't want to do that. I like putting tests adjacent to the code they're testing.
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先阅读 nodeunit 在 `nodeunit .` 命令周围的测试发现和模块加载行为;issue 未指定任何源文件或测试。比较导出函数的处理方式与所需的相邻测试布局。完成的标准是,所有预期的测试仍然运行,且不会调用为复用而导出的辅助函数。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- testing-qa
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100