diff --git a/karma.conf.js b/karma.conf.js index 8d43e50..9e69b8a 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -18,6 +18,7 @@ module.exports = function(config) { browserNoActivityTimeout: 1500, captureTimeout: 3000, client: { + args: [], mocha: { timeout: 1500, ui: 'bdd' @@ -70,8 +71,8 @@ module.exports = function(config) { singleRun: true }; - if (process.env.TRAVIS) { - settings.exclude = ['test/spec/reader/*.js']; + if (process.env.CI) { + settings.client.args.push('ci'); settings.browsers = ['Chrome_travis_ci']; } diff --git a/test/spec/reader/speaker.spec.js b/test/spec/reader/speaker.spec.js index b84170a..50abae3 100644 --- a/test/spec/reader/speaker.spec.js +++ b/test/spec/reader/speaker.spec.js @@ -1,5 +1,7 @@ import Speaker from '../../../src/reader/speaker'; +const isCI = window.__karma__.config.args.indexOf('ci') >= 0; // jscs:disable disallowDanglingUnderscores + /** * @test {Speaker} */ @@ -39,6 +41,12 @@ describe('Speaker', function() { }); describe('isSpeaking()', function() { + before(function() { + if (isCI) { + this.skip(); + } + }); + beforeEach(function() { speaker.cancel(); }); @@ -87,6 +95,12 @@ describe('Speaker', function() { }); describe('speak()', function() { + before(function() { + if (isCI) { + this.skip(); + } + }); + context('with the default settings', function() { it('should prompt the text provided', function() { let text = 'hello'; @@ -172,6 +186,12 @@ describe('Speaker', function() { }); describe('events', function() { + before(function() { + if (isCI) { + this.skip(); + } + }); + it('should trigger a webreader.synthesisstart event when a text starts being prompted', function() { let text, synthesisStartSpy, speakSpy;