diff --git a/.travis.yml b/.travis.yml index d07eee6..cc9756c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,9 @@ before_install: - npm install -g grunt-cli - bower install script: -- karma start +- grunt karma +after_script: +- grunt coveralls addons: sauce_connect: true env: diff --git a/Gruntfile.js b/Gruntfile.js index 930b929..d18b3d7 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -19,30 +19,30 @@ var gruntConfig = { src: ['videojs.vast.js', specs], }, }, - jasmine: { - src: 'videojs.vast.js', - options: { - specs: specs, - helpers: helpers, - vendor: [ - "http://vjs.zencdn.net/4.4.3/video.js", - "bower_components/videojs-contrib-ads/src/videojs.ads.js", - "lib/vast-client.js" - ] + // jasmine: { + // src: 'videojs.vast.js', + // options: { + // specs: specs, + // helpers: helpers, + // vendor: [ + // "http://vjs.zencdn.net/4.4.3/video.js", + // "bower_components/videojs-contrib-ads/src/videojs.ads.js", + // "lib/vast-client.js" + // ] + // } + // }, + karma: { + unit: { + configFile: 'karma.conf.js' } }, - simplemocha: { - sauce: { - options: { - timeout: 60000, - reporter: "spec" - }, - src: ["spec/sauce-wd.js"] + coveralls: { + options: { + coverage_dir: './coverage', + force: true, + recursive: true } }, - concurrent: { - "test-sauce": [] - }, connect: { server: { options: { @@ -58,23 +58,16 @@ var gruntConfig = { } }; -_(desireds).each(function(desired, key) { - gruntConfig.env[key] = { - DESIRED: JSON.stringify(desired) - }; - gruntConfig.concurrent['test-sauce'].push('test:sauce:' + key); -}); - module.exports = function(grunt) { grunt.initConfig(gruntConfig); grunt.loadNpmTasks('grunt-env'); grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-contrib-jasmine'); grunt.loadNpmTasks('grunt-contrib-connect'); - grunt.loadNpmTasks('grunt-simple-mocha'); grunt.loadNpmTasks('grunt-concurrent'); + grunt.loadNpmTasks('grunt-karma-coveralls'); + grunt.loadNpmTasks('grunt-karma'); grunt.registerTask('default', ['test:sauce:' + _(desireds).keys().first()]); @@ -82,6 +75,5 @@ module.exports = function(grunt) { grunt.registerTask('test:sauce:' + key, ['env:' + key, 'simplemocha:sauce']); }); - grunt.registerTask('default', ['jshint', 'jasmine', 'watch']); - grunt.registerTask('travis', ['jshint', 'jasmine', 'concurrent:test-sauce']); + grunt.registerTask('default', ['jshint', 'karma']); }; diff --git a/package.json b/package.json index ebceba7..37a23c5 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "karma-jasmine": "~0.2.0", "karma-sauce-launcher": "~0.2.10", "karma-phantomjs-launcher": "~0.1.4", + "grunt-karma-coveralls": "2.5.1", "lodash": "~2.4.1", "wd": "~0.2.12" diff --git a/videojs.vast.js b/videojs.vast.js index 17236ac..70762c7 100644 --- a/videojs.vast.js +++ b/videojs.vast.js @@ -273,4 +273,4 @@ }; vjs.plugin('vast', vastPlugin); -}(videojs, DMVAST)); +}(window.videojs, window.DMVAST));