Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I'm using Travis-CI to lint and test frontend javascript code programmatically (using Gruntjs).

My question is if I build a plugin and I want to test it on multiple version of a script, how can I manage this ?

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

like image 732
Simon Boudrias Avatar asked Sep 02 '12 19:09

Simon Boudrias


2 Answers

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

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

like image 147
nschonni Avatar answered Sep 30 '22 20:09

nschonni


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

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

env:
  - JQUERY=1.11
  - JQUERY=2.2
  - JQUERY=3.0.0-beta1
install:
  - npm install
  - npm install jquery@$JQUERY
like image 24
Marc-André Lafortune Avatar answered Sep 30 '22 20:09

Marc-André Lafortune