@@ -14,23 +14,24 @@ describe('DefaultSubmissionClient', () => {
1414 } else {
1515 expect ( response . message ) . toBe ( 'Unable to connect to server.' ) ;
1616 }
17+
18+ done ( ) ;
1719 }
1820
1921 var config = new Configuration ( { apiKey :'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw' , serverUrl :'http://localhost:50000' } ) ;
2022 var submissionClient = new DefaultSubmissionClient ( ) ;
21- submissionClient . submit ( [ { type : 'log' , message : 'From js client' , reference_id : '123454321' } ] , config )
22- . then ( processResponse , processResponse )
23- . then ( done ) ;
23+ submissionClient . submit ( [ { type : 'log' , message : 'From js client' , reference_id : '123454321' } ] , config , processResponse ) ;
2424 } , 5000 ) ;
2525
26-
2726 it ( 'should submit invalid object data' , ( done ) => {
2827 function processResponse ( response :SubmissionResponse ) {
2928 if ( response . success ) {
3029 expect ( response . message ) . toBe ( null ) ;
3130 } else {
3231 expect ( response . message ) . toBe ( 'Unable to connect to server.' ) ;
3332 }
33+
34+ done ( ) ;
3435 }
3536
3637 var config = new Configuration ( { apiKey :'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw' , serverUrl :'http://localhost:50000' } ) ;
@@ -40,9 +41,7 @@ describe('DefaultSubmissionClient', () => {
4041 } } ;
4142
4243 var submissionClient = new DefaultSubmissionClient ( ) ;
43- submissionClient . submit ( [ event ] , config )
44- . then ( processResponse , processResponse )
45- . then ( done ) ;
44+ submissionClient . submit ( [ event ] , config , processResponse ) ;
4645 } , 5000 ) ;
4746
4847 it ( 'should submit user description' , ( done ) => {
@@ -52,13 +51,13 @@ describe('DefaultSubmissionClient', () => {
5251 } else {
5352 expect ( response . message ) . toBe ( 'Unable to connect to server.' ) ;
5453 }
54+
55+ done ( ) ;
5556 }
5657
5758 var config = new Configuration ( { apiKey :'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw' , serverUrl :'http://localhost:50000' } ) ;
5859 var submissionClient = new DefaultSubmissionClient ( ) ;
59- submissionClient . submitDescription ( '123454321' , { email_address :
'[email protected] ' , description :
'unit test' } , config ) 60- . then ( processResponse , processResponse )
61- . then ( done ) ;
60+ submissionClient . submitDescription ( '123454321' , { email_address :
'[email protected] ' , description :
'unit test' } , config , processResponse ) 6261 } , 5000 ) ;
6362
6463 it ( 'should get project settings' , ( done ) => {
@@ -70,12 +69,12 @@ describe('DefaultSubmissionClient', () => {
7069 } else {
7170 expect ( response . message ) . toBe ( 'Unable to connect to server.' ) ;
7271 }
72+
73+ done ( ) ;
7374 }
7475
7576 var config = new Configuration ( { apiKey :'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw' , serverUrl :'http://localhost:50000' } ) ;
7677 var submissionClient = new DefaultSubmissionClient ( ) ;
77- submissionClient . getSettings ( config )
78- . then ( processResponse , processResponse )
79- . then ( done ) ;
78+ submissionClient . getSettings ( config , processResponse ) ;
8079 } , 5000 ) ;
8180} ) ;
0 commit comments