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 ?
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With