How to use travis-ci or grunt to test with different versions of the script

I use Travis-CI to pile and test JavaScript code in the interface programmatically (using Gruntjs).

My question is that I am building a plugin and I want to test it on several versions of the script, how can I do this?

For example, a simple usage example would be if I create a jQuery plugin, can I ask grunt or travis to run it using a test using version 1.6, then 1.7, and then 1.8?

+7
source share
2 answers

I used the instructions http://manuelvanrijn.nl/blog/2012/06/22/integrate-travis-ci-into-grunt/ to work with Travis-CI integration.

For multiple jQuery versions check how jQuery validation does it https://github.com/jzaefferer/jquery-validation/blob/master/test/index.html

+4
source

In travis.ci, the best solution is to use their build matrix.

For example, using an environment variable to store the version in use, you can specify a specific version after npm install :

 env: - JQUERY=1.11 - JQUERY=2.2 - JQUERY=3.0.0-beta1 install: - npm install - npm install jquery@ $JQUERY 
+1
source

All Articles