describe('File Module', function () { before(() => { return Edge.Client.connect(); }); after(() => { Edge.Client.disconnect(); }); it('should upload then download a blob', function () { const content = JSON.stringify({ "date": new Date() }); const blob = new Blob([content], { type: "application/json" }); return Edge.Client.upload(blob) .then(upload => upload.result()) .then(result => { chai.assert.isNotEmpty(result.blobId); chai.assert.isNotEmpty(result.bucket); const blobUrl = Edge.Client.blobUrl(result.bucket, result.blobId); chai.assert.isNotEmpty(blobUrl); return fetch(blobUrl) .then(res => res.text()) .then(blobContent => { chai.assert.equal(content, blobContent); }); }) .catch(err => { chai.assert.fail(err); }) }); });