4

From what I understand, there are two major packages that help in testing a package - TinyTest, and Velocity, which became the official Meteor testing framework.

From the Meteor's DevShop in June, the Velocity team said that Velocity can run alongside TinyTest, but I do not understand the difference in the features these two packages provides, is one (TinyTest) redundant?

Is TinyTest only meant for unit testing? If I want integration testing, functional testing, would I need to turn to Velocity and its supported frameworks? Or something else completely different? There is a comparison table, but it is a bit dated.

dayuloli
  • 16,205
  • 16
  • 71
  • 126

2 Answers2

5

TinyTest is currently the only solution that allows you to test packages, this is one of the reasons why it's still on the map. The other reason is that TinyTest was the official testing solution prior to Velocity and as such it still has a following.

Unit testing (both server and client) is currently only supported by Jasmine. Integration testing (both server and client) is supported by Jasmine and Mocha-web. End-to-end testing is supported by Xolv.io Cucumber, and also Casper and Nightwatch. You can also add Xolv.io webdriver to mocha/jasmine and in fact you can even add webdriver to TinyTest if you want!

You may find this blog post I wrote useful, it talks about the different testing modes of Meteor and also has a comparison table at the bottom.

You might also find this chapter I wrote on Velocity useful.

Xolv.io
  • 2,483
  • 1
  • 15
  • 17
  • Hi Sam, thanks for your work with Velocity. I managed to (kind of) figure it out last night from another answer you gave on SO some time ago...So now, I'm using TinyTest to unit test my package, and created an `example` directory, inside of which I created a test application, and inside that application I am using `mike:mocha` for integration testing. Haven't explored Cucumber, Casper, Nightwatch nor your webdriver yet, but will do so soon! Can't wait until TinyTest is supported by Velocity! – dayuloli Jan 12 '15 at 04:04
  • I would recommend cucumber, and of course the disclaimer is I wrote it :) – Xolv.io Jan 12 '15 at 04:19
  • Hey, Sam . You say, "TinyTest is currently the only solution that allows you to test packages." Things change fast with meteor; so now 10 weeks on -- is this still true? If so, to test my little package "in-the-wild", I must create an accompanying demo app that requires my package and run Cucumber on it, correct? – Martin Bramwell Mar 22 '15 at 13:55
  • 2
    If you're brave, you can check this out mocha package testing solution that is not public yet. https://github.com/mad-eye/meteor-mocha-web/tree/packageTest You're correct in your "in-the-wild" approach. – Xolv.io Mar 22 '15 at 19:06
  • 2
    See https://blog.respond.ly/testing-meteor-packages-with-mocha/, https://github.com/rissem/leaderboard-package-mocha, https://youtu.be/puoD7b4Ow7k?t=1h7m for more. – jiku Apr 02 '15 at 20:02
1

You can test package with Velocity+Jasmine.

Go to see and example here, and use this command to run test.

VELOCITY_TEST_PACKAGES=1 meteor test-packages --driver-package velocity:html-reporter package-to-test