2013-06-19 24 views
0

我試圖讓流星TDD,根據這個帖子http://blog.xolv.io/2013/04/unit-testing-with-meteor.html流星和TDD的領先應用

我寫我的test.js,但是當我啓動應用程序時,我得到這個錯誤:

ReferenceError: describe is not defined 
at app/test/unit/test.js:1:16 
at C:\Programmi\Meteor\examples\leaderboard\.meteor\local\build\server\server.js:294:12 
at Array.forEach (native) 
at Function._.each._.forEach 
(C:\Programmi\Meteor\lib\node_modules\underscore\underscore.js:79:11) 
at run 
(C:\Programmi\Meteor\examples\leaderboard\.meteor\local\build\server\server.js:227:7) 

回答

1

你需要茉莉花或摩卡安裝才能使用像描述的方法,期望,TOBE等

正如文章的#4中提到的作者:

Notes:

  1. We now have a Meteor object. Hoorah.

  2. When Meteor.Startup is called, the function is used to replace itself. This means in a unit test, if you refer to Meteor.startup, you'll get access to the startup function and can test it, as you can see in the server unit test below.

  3. The collection constructor exists now and it keeps track of how many times a collection is created so you can make assertions, like in the model test below.

  4. A prototype containing all the collection methods as per the Meteor documentation. This will allow you to add spies with frameworks such as Jasmine or Mocha which expect the methods to exist before spying.

+0

謝謝安德烈,但安裝茉莉花後 「npm install jasmine-node」 問題依然存在 –