forked from microsoft/react-native-code-push
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmockAcquisitionSdk.js
More file actions
29 lines (23 loc) · 1.1 KB
/
mockAcquisitionSdk.js
File metadata and controls
29 lines (23 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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;