Skip to content

Commit

Permalink
Tests: Skip only tests that need an audio device
Browse files Browse the repository at this point in the history
  • Loading branch information
AurelioDeRosa committed May 19, 2016
1 parent 96b1f21 commit 294a009
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
5 changes: 3 additions & 2 deletions karma.conf.js
Expand Up @@ -18,6 +18,7 @@ module.exports = function(config) {
browserNoActivityTimeout: 1500,
captureTimeout: 3000,
client: {
args: [],
mocha: {
timeout: 1500,
ui: 'bdd'
Expand Down Expand Up @@ -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'];
}

Expand Down
20 changes: 20 additions & 0 deletions 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}
*/
Expand Down Expand Up @@ -39,6 +41,12 @@ describe('Speaker', function() {
});

describe('isSpeaking()', function() {
before(function() {
if (isCI) {
this.skip();
}
});

beforeEach(function() {
speaker.cancel();
});
Expand Down Expand Up @@ -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';
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 294a009

Please sign in to comment.