in Tasks/codepush-release-cordova/test.js [54:73]
function performDeployTask(shouldFail) {
var performDeployTaskSpy = sinon.spy(CodePush, "performDeployTask");
spies.push(CodePush.performDeployTask)
var tlSetResultSpy = sinon.stub(tl, "setResult").callsFake(function() {});
spies.push(tl.setResult);
try {
CodePush.performDeployTask(ACCESS_KEY, APP_NAME, APP_STORE_VERSION, PLATFORM, DEPLOYMENT_NAME, DESCRIPTION, ROLLOUT, IS_MANDATORY, IS_DISABLED, SHOULD_BUILD);
} catch (e) {
assert(shouldFail, "Threw an unexpected error");
}
if (shouldFail) {
assert(performDeployTaskSpy.threw(), "Did not throw an error");
assert.equal(tlSetResultSpy.called && tlSetResultSpy.firstCall.args[0], 1, "Did not set task result to 1 on failure");
} else {
assert(!tlSetResultSpy.called, "Should not set task result if task succeeds");
}
}