此应用程序显示了使用 Cucumber 测试 Meteor 的示例: https://github.com/mhurwi/cucumber-meteor-tutorial
它与 Velocity 配合良好。但是,当使用 Velocity 启动应用程序时,我的计算机变得非常慢,并且我不希望它在我开发时始终运行。所以我尝试使用 Chimp 作为 NPM 模块
chimp --ddp=http://localhost:3000
按照此处的建议: https://chimp.readme.io/docs/getting-started-with-meteor-cucumber
但是使用方法调用的测试(方法位于tests/cucumber/fixtures/中)不起作用:
Error: Method not found [404]
有人知道我应该做什么才能使用命令行而不是 Velocity 运行 Cucumber 测试吗?
感谢您的帮助。
另一个小问题:第一次启动时 Velocity 是否需要很长时间(我只进行了一些测试,它几乎卡住了我的计算机)还是每次都一样?
最佳答案
当针对 Meteor 运行 Chimp 时,您不能将固定装置放入 tests/cucumber/fixtures
中,您必须使用固定装置包模式,请参见此处:
https://meteor-testing.readme.io/docs/data-fixtures
然后您可以使用步骤定义中的 server.call('xxx')
调用装置
关于meteor - 黑猩猩和 meteor : method calls in tests without using Velocity,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33816027/