为什么 jasmine-node 找不到我的规范文件?
我已经使用 npm 安装了 jasmine-node。我的项目的目录结构如下:
|-lib\
|-taxCalc.js
|-spec\
|-taxCalc.spec.coffee
|-taxCalc.spec.js
|-src\
|-taxCalc.coffee
当我使用以下命令从根文件夹运行 jasmine-node 时(对于 CoffeeScript):
jasmine-node --coffee --verbose spec
Finished in 0.015 seconds
0 tests, 0 assertions, 0 failures
如果我运行 JavaScript 版本,则相同。
如果我明确指向规范文件测试运行良好:
jasmine-node --coffee --verbose spec/taxCalc.spec.coffee
Tax calculation
calculates tax
Finished in 0.009 seconds
1 test, 1 assertion, 0 failures
文档表明文件名应以“spec.js”或“spec.coffee”结尾,因此一切似乎都正常。
PS 我在 Windows 7 上运行。
I have installed jasmine-node using npm. My project's directory structure are following:
|-lib\
|-taxCalc.js
|-spec\
|-taxCalc.spec.coffee
|-taxCalc.spec.js
|-src\
|-taxCalc.coffee
When I run jasmine-node from root folder with following command (for CoffeeScript):
jasmine-node --coffee --verbose spec
Finished in 0.015 seconds
0 tests, 0 assertions, 0 failures
Same if I run JavaScript version.
If I explicitly point to spec file tests run fine:
jasmine-node --coffee --verbose spec/taxCalc.spec.coffee
Tax calculation
calculates tax
Finished in 0.009 seconds
1 test, 1 assertion, 0 failures
Documentation says that file names should end with 'spec.js' or 'spec.coffee', so everything seems ok.
P.S. I am running on Windows 7.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Jasmine-node 已于上周更新为使用 walkdir 而不是 findit,现在使其可以在 Windows 中运行。重新运行
npm install jasmine-node
进行更新。Jasmine-node has been updated in the last week to use walkdir instead of findit which now makes it function in windows. Re-run
npm install jasmine-node
for the update.偶然发现了同样的问题,并且阅读 MarisKs 链接为时已晚:/ - 但得出了与问题中描述的相同的结论:
至少在 Windows 7 上,file.stat.ino 始终返回 0,因此 findit/index.js 中的函数 createInodeChecker() 始终返回 true,并且将跳过该文件。
最简单的即时修复:将 createInodeChecker 编辑为
Not Nice,但您可以使用它。
Stumbled upon the same problem and have read MarisKs link too late :/ - but came to the same conclusion as described in the issue:
At least on Windows 7, file.stat.ino returns always 0, so the function createInodeChecker() in findit/index.js returns always true and the file will be skipped.
Easiest on-the-fly-fix: edit createInodeChecker to
Not nice, but you can work with it.