mirror of
https://github.com/zhigang1992/react-native-code-push.git
synced 2026-06-10 15:49:36 +08:00
29 lines
1.1 KiB
JavaScript
29 lines
1.1 KiB
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);
|
|
};
|
|
|
|
AcquisitionManager.prototype.reportStatusDeploy = (deployedPackage, status, callback) => {
|
|
// No-op and return success.
|
|
callback(null, null);
|
|
};
|
|
|
|
AcquisitionManager.prototype.reportStatusDownload = (downloadedPackage, callback) => {
|
|
// No-op and return success.
|
|
callback(null, null);
|
|
};
|
|
|
|
return AcquisitionManager;
|
|
}
|
|
|
|
export default createMockAcquisitionSdk; |