@@ -14,23 +14,24 @@ describe('DefaultSubmissionClient', () => {
14
14
} else {
15
15
expect ( response . message ) . toBe ( 'Unable to connect to server.' ) ;
16
16
}
17
+
18
+ done ( ) ;
17
19
}
18
20
19
21
var config = new Configuration ( { apiKey :'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw' , serverUrl :'http://localhost:50000' } ) ;
20
22
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 ) ;
24
24
} , 5000 ) ;
25
25
26
-
27
26
it ( 'should submit invalid object data' , ( done ) => {
28
27
function processResponse ( response :SubmissionResponse ) {
29
28
if ( response . success ) {
30
29
expect ( response . message ) . toBe ( null ) ;
31
30
} else {
32
31
expect ( response . message ) . toBe ( 'Unable to connect to server.' ) ;
33
32
}
33
+
34
+ done ( ) ;
34
35
}
35
36
36
37
var config = new Configuration ( { apiKey :'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw' , serverUrl :'http://localhost:50000' } ) ;
@@ -40,9 +41,7 @@ describe('DefaultSubmissionClient', () => {
40
41
} } ;
41
42
42
43
var submissionClient = new DefaultSubmissionClient ( ) ;
43
- submissionClient . submit ( [ event ] , config )
44
- . then ( processResponse , processResponse )
45
- . then ( done ) ;
44
+ submissionClient . submit ( [ event ] , config , processResponse ) ;
46
45
} , 5000 ) ;
47
46
48
47
it ( 'should submit user description' , ( done ) => {
@@ -52,13 +51,13 @@ describe('DefaultSubmissionClient', () => {
52
51
} else {
53
52
expect ( response . message ) . toBe ( 'Unable to connect to server.' ) ;
54
53
}
54
+
55
+ done ( ) ;
55
56
}
56
57
57
58
var config = new Configuration ( { apiKey :'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw' , serverUrl :'http://localhost:50000' } ) ;
58
59
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 )
62
61
} , 5000 ) ;
63
62
64
63
it ( 'should get project settings' , ( done ) => {
@@ -70,12 +69,12 @@ describe('DefaultSubmissionClient', () => {
70
69
} else {
71
70
expect ( response . message ) . toBe ( 'Unable to connect to server.' ) ;
72
71
}
72
+
73
+ done ( ) ;
73
74
}
74
75
75
76
var config = new Configuration ( { apiKey :'LhhP1C9gijpSKCslHHCvwdSIz298twx271n1l6xw' , serverUrl :'http://localhost:50000' } ) ;
76
77
var submissionClient = new DefaultSubmissionClient ( ) ;
77
- submissionClient . getSettings ( config )
78
- . then ( processResponse , processResponse )
79
- . then ( done ) ;
78
+ submissionClient . getSettings ( config , processResponse ) ;
80
79
} , 5000 ) ;
81
80
} ) ;
0 commit comments