Chimpjs 和 Meteor:不使用 Velocity 的测试中的方法调用 [英] Chimpjs and Meteor: method calls in tests without using Velocity
问题描述
This app shows an example of testing Meteor with Cucumber: https://github.com/mhurwi/cucumber-meteor-tutorial
It works well with Velocity. But my computer becomes very slow when starting an app with Velocity and I don't want it to always run when I'm developing. So I tried to use Chimp as an NPM module by using
chimp --ddp=http://localhost:3000
as proposed here: https://chimp.readme.io/docs/getting-started-with-meteor-cucumber
But the tests with method calls (the methods are in tests/cucumber/fixtures/) don't work:
Error: Method not found [404]
Does anyone have an idea of what I should do in order to run the Cucumber tests using the command line instead of Velocity?
Thank you for your help.
Another small question: does Velocity take a lot of time when it's the first launch (I only have a few tests and it nearly freezes my computer) or is it the same every time?
When running Chimp against Meteor, you can't put fixtures in tests/cucumber/fixtures
, you have to use the fixture package pattern, see here:
https://meteor-testing.readme.io/docs/data-fixtures
Then you can call the fixtures using server.call('xxx')
from your step defs
这篇关于Chimpjs 和 Meteor:不使用 Velocity 的测试中的方法调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!