Skip to content
This repository was archived by the owner on Jun 24, 2024. It is now read-only.

Commit 8998801

Browse files
author
Ben Stahl
committed
Test the contentLength is appropriately handled
1 parent 7235144 commit 8998801

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,17 @@ describe('gcs-resumable-upload', function () {
215215
assert.strictEqual(up.numRetries, 0)
216216
})
217217

218+
it('should set the contentLength if provided', function () {
219+
var CONTENT_LENGTH = 1024
220+
var up = upload({ bucket: BUCKET, file: FILE, metadata: { contentLength: CONTENT_LENGTH } })
221+
assert.strictEqual(up.contentLength, CONTENT_LENGTH)
222+
})
223+
224+
it('should default the contentLength to *', function () {
225+
var up = upload({ bucket: BUCKET, file: FILE })
226+
assert.strictEqual(up.contentLength, '*')
227+
})
228+
218229
it('should localize the uri or get one from config', function () {
219230
var uri = 'http://www.blah.com/'
220231
var upWithUri = upload({ bucket: BUCKET, file: FILE, uri: uri })

0 commit comments

Comments
 (0)