cordovameteortinytest

How do I run Tinytest on an android device for testing package for meteor-cordova app?


I want to test cordova specific feature of meteor-package using Tinytest on android device. So I have tried the steps found here.

My test file cordova-test.js contains only the following

if (Meteor.isCordova) {
   Tinytest.add("cordova-package - First Test ", function(test) {
       test.equal(1, 1, "Equal test");
   });
}

My package.js have the following Package.onTest()

 Package.onTest(function(api) {
  api.use(['tinytest','test-helpers']);
  api.use('sujith3g:cordova-package');
  api.addFiles('tests/cordova-test.js', "client");
});

I have used meteor test-packages --android-device ./ command to exceute the tests. Then it gave me

Testing in progress..

message on the android device for a long time, It is not even starting the test. Do I need to do anything else for testing a package on android device using Tinytest ? Please help me.


Solution

  • After trying all combinations of meteor test-packages, I got it working on android device by using this.

    meteor test-packages --android-device ./ --mobile-server http://192.168.1.4:3000

    The mobile-server(--mobile-server http://<host>:<port>) argument is required for it to work on android device