How can I get Meteor module tests (client) (using Velocity with Jasmine) to work in Cordoba on the device?

I have a Meteor mobile project (Cordova + Ionic Framework + Angular-Meteor) with unit tests configured with Velocity and Jasmine . When testing in a browser, client tests run as expected, but they don’t run on mobile devices. The tested servers are located on the local host, so the devices cannot find my computer, which hosts applications and test servers. How can I change the host of Velocity test speed servers from localhost to my LAN IP?

0
source share
1 answer

You need to set the environment variable ROOT_URL . I found that if my main (non-unit testing) Meteor application showed from 192.168.0.222haps000, my ROOT_URL variable should look like this:

ROOT_URL="http://192.168.0.222:3000"

Speed ​​uses different ports for client servers and unit test servers. 3000 in the variable ROOT_URL will be changed to the corresponding ports and will use the IP address 192.168.0.222.

Here my test script is similar to running my application on my Android device. Pay attention to the variable ROOT_URL, in particular:

 echo echo echo "TIP: If you have changed IPs, delete your app from device first" MONGO_URL="foo" \ MONGO_OPLOG_URL="bar" \ ROOT_URL="http://192.168.0.222:3000" \ VELOCITY_MONGO_URL="mongodb://127.0.0.1:27017/my_unit_test_db" \ meteor run android-device --mobile-server 192.168.0.222:3000 
0
source

Source: https://habr.com/ru/post/1213656/


All Articles