@@ -83,15 +83,17 @@ exports.UpdateCheckRequestMock = UpdateCheckRequestMock;
83
83
*/
84
84
function createDefaultResponse ( ) {
85
85
var defaultResponse = new CheckForUpdateResponseMock ( ) ;
86
- defaultResponse . downloadURL = "" ;
86
+ defaultResponse . download_url = "" ;
87
+ defaultResponse . is_disabled = false ;
87
88
defaultResponse . description = "" ;
88
- defaultResponse . isAvailable = false ;
89
- defaultResponse . isMandatory = false ;
90
- defaultResponse . appVersion = "" ;
91
- defaultResponse . packageHash = "" ;
89
+ defaultResponse . is_available = false ;
90
+ defaultResponse . is_mandatory = false ;
91
+ defaultResponse . target_binary_range = "" ;
92
+ defaultResponse . package_hash = "" ;
92
93
defaultResponse . label = "" ;
93
- defaultResponse . packageSize = 0 ;
94
- defaultResponse . updateAppVersion = false ;
94
+ defaultResponse . package_size = 0 ;
95
+ defaultResponse . should_run_binary_version = false ;
96
+ defaultResponse . update_app_version = false ;
95
97
return defaultResponse ;
96
98
}
97
99
exports . createDefaultResponse = createDefaultResponse ;
@@ -102,19 +104,21 @@ function createUpdateResponse(mandatory, targetPlatform, randomHash) {
102
104
if ( mandatory === void 0 ) { mandatory = false ; }
103
105
if ( randomHash === void 0 ) { randomHash = true ; }
104
106
var updateResponse = new CheckForUpdateResponseMock ( ) ;
105
- updateResponse . isAvailable = true ;
106
- updateResponse . appVersion = "1.0.0" ;
107
- updateResponse . downloadURL = "mock.url/download" ;
108
- updateResponse . isMandatory = mandatory ;
107
+ updateResponse . is_available = true ;
108
+ updateResponse . is_disabled = false ;
109
+ updateResponse . target_binary_range = "1.0.0" ;
110
+ updateResponse . download_url = "mock.url/v0.1/public/codepush/report_status/download" ;
111
+ updateResponse . is_mandatory = mandatory ;
109
112
updateResponse . label = "mock-update" ;
110
- updateResponse . packageHash = "12345-67890" ;
111
- updateResponse . packageSize = 12345 ;
112
- updateResponse . updateAppVersion = false ;
113
+ updateResponse . package_hash = "12345-67890" ;
114
+ updateResponse . package_size = 12345 ;
115
+ updateResponse . should_run_binary_version = false ;
116
+ updateResponse . update_app_version = false ;
113
117
if ( ! ! targetPlatform )
114
- updateResponse . downloadURL = targetPlatform . getServerUrl ( ) + "/download" ;
118
+ updateResponse . download_url = targetPlatform . getServerUrl ( ) + "/v0.1/public/codepush/report_status /download" ;
115
119
// We need unique hashes to avoid conflicts.
116
120
if ( randomHash ) {
117
- updateResponse . packageHash = "randomHash-" + Math . floor ( Math . random ( ) * 10000 ) ;
121
+ updateResponse . package_hash = "randomHash-" + Math . floor ( Math . random ( ) * 10000 ) ;
118
122
}
119
123
return updateResponse ;
120
124
}
0 commit comments