@@ -29,14 +29,15 @@ function getAudio() {
29
29
// integration = testing against actual watson servers
30
30
var offline = process . env . TEST_MODE !== 'integration' ;
31
31
var chrome = navigator . userAgent . indexOf ( 'Chrome' ) >= 0 ;
32
+ var travis = ! ! process . env . TRAVIS ;
32
33
33
34
describe ( "WatsonSpeechToText" , function ( ) {
34
35
35
36
this . timeout ( 30 * 1000 ) ;
36
37
37
38
// not sure why, but I can't convince firefox or chrome to actually play <audio> elements during tests
38
- // todo: file a stack overflow or something
39
- ( offline ? it : xit ) ( 'should transcribe <audio> elements' , function ( done ) {
39
+ // also, on travis, the element never appears to stop playing (or, more likely, it nevers starts in the first place)
40
+ ( offline && ! travis ? it : xit ) ( 'should transcribe <audio> elements' , function ( done ) {
40
41
getConfig ( ) . then ( function ( cfg ) {
41
42
var audioElement = new Audio ( ) ;
42
43
audioElement . src = "http://localhost:9877/audio.wav" ;
@@ -56,8 +57,9 @@ describe("WatsonSpeechToText", function() {
56
57
} ) ;
57
58
58
59
// firefox can automatically approve getUserMedia, but not playback audio, so offline only
60
+ // ...except on travis ci, where it gets NO_DEVICES_FOUND
59
61
// chrome can do both, so it gets tested on and offline
60
- ( offline || chrome ? it : xit ) ( "should transcribe mic input" , function ( done ) {
62
+ ( offline && ! travis || chrome ? it : xit ) ( "should transcribe mic input" , function ( done ) {
61
63
getConfig ( ) . then ( function ( cfg ) {
62
64
var stt = WatsonSpeechToText . recognizeMicrophone ( cfg ) ;
63
65
//stt.on('send-json', console.log.bind(console, 'sending'));
0 commit comments