Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Travis-CI for client-side JavaScript libraries?

I'm not sure to use Travis-CI for my client-side JavaScript library or not, because it compiles with NodeJs on Travis-CI servers.

I want to know is this a good approach to use some kind of continuous integration such as Travis-CI for client-side libraries or not?

like image 835
Afshin Mehrabani Avatar asked Nov 16 '12 07:11

Afshin Mehrabani


1 Answers

Yes of course you should use continous integration with client side libraries.

I personally use PhantomJS (headless webkit browser) which is already installed in Travis-CI. I think this is the better option for client-side stuff than NodeJs.

If you use Grunt, it gets even easier to use, all you need is a simple Gruntfile.js file, your tests that run in browser (I use QUnit), and a simple .travis.yml

Gruntfile.js:

module.exports = function(grunt) {     // Project configuration.     grunt.initConfig({         qunit: {             files: ['test/index.html']         }     });      // Load plugin     grunt.loadNpmTasks('grunt-contrib-qunit');      // Task to run tests     grunt.registerTask('test', 'qunit'); }; 

.travis.yml:

before_script:   - sudo npm install -g grunt  script: grunt test --verbose --force 

You can see it in action at one of my projects (source on GitHub).

like image 150
Odi Avatar answered Sep 30 '22 16:09

Odi