Skip to content

Commit

Permalink
update testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourav authored and Sourav committed Mar 4, 2022
1 parent b003410 commit d0a6851
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/unit/bin/helpers/checkUploaded.js
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ describe("checkUploaded", () => {
});
});

it("resolves with zipUrlPresent false and packageUrlPresent true if force-upload enabled and cache_dependencies enabled", () => {
it("resolves with zipUrlPresent false and packageUrlPresent false if force-upload enabled and cache_dependencies enabled", () => {
let requestStub = sandbox
.stub(request, "post")
.yields(null, { statusCode: 200 }, '{"npmPackageUrl":"bs://random_hashid2"}');
Expand All @@ -219,11 +219,12 @@ describe("checkUploaded", () => {
bsConfig.run_settings.cache_dependencies = true
return checkUploadedMd5rewire(bsConfig, {"force-upload": true}, instrumentBlocks)
.then((data) => {
chai.assert.deepEqual(data, { zipUrlPresent: false, packageUrlPresent: true, npm_package_md5sum: 'random_md5sum', npmPackageUrl: 'bs://random_hashid2' })
sinon.assert.calledOnce(requestStub);
sinon.assert.calledOnce(checkSpecsMd5Stub);
chai.assert.deepEqual(data, { zipUrlPresent: false, packageUrlPresent: false })
sinon.assert.notCalled(requestStub);
sinon.assert.notCalled(checkSpecsMd5Stub);
})
.catch((_error) => {
console.log(_error)
chai.assert.fail("Promise error");
});
});
Expand Down

0 comments on commit d0a6851

Please sign in to comment.