mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-06-10 23:59:42 +08:00
19 lines
807 B
JavaScript
19 lines
807 B
JavaScript
import assert from "assert";
|
|
|
|
function createMockAcquisitionSdk(serverPackage, localPackage, expectedDeploymentKey) {
|
|
let AcquisitionManager = (httpRequester, configuration) => {
|
|
expectedDeploymentKey && assert.equal(expectedDeploymentKey, configuration.deploymentKey, "checkForUpdate did not initialize Acquisition SDK with the expected deployment key");
|
|
};
|
|
|
|
AcquisitionManager.prototype.queryUpdateWithCurrentPackage = (queryPackage, callback) => {
|
|
if (localPackage) {
|
|
localPackage.appVersion = queryPackage.appVersion;
|
|
assert.deepEqual(queryPackage, localPackage, "checkForUpdate did not attach current package info to the acquisition request");
|
|
}
|
|
callback(/*err:*/ null, serverPackage);
|
|
};
|
|
|
|
return AcquisitionManager;
|
|
}
|
|
|
|
export default createMockAcquisitionSdk; |