diff --git a/Libraries/Blob/Blob.js b/Libraries/Blob/Blob.js index 590f48fc50dc..8d9ddc4603a4 100644 --- a/Libraries/Blob/Blob.js +++ b/Libraries/Blob/Blob.js @@ -92,7 +92,7 @@ class Blob { * Currently we only support creating Blobs from other Blobs. * Reference: https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob */ - constructor(parts: Array, options: any) { + constructor(parts: Array = [], options: any) { const blobId = uuid(); let size = 0; parts.forEach((part) => { diff --git a/Libraries/Blob/__tests__/Blob-test.js b/Libraries/Blob/__tests__/Blob-test.js new file mode 100644 index 000000000000..c9f42e4418cd --- /dev/null +++ b/Libraries/Blob/__tests__/Blob-test.js @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + * + */ +'use strict'; + + +test('Blob construct', () => { + expect(() => new Blob()).not.toThrow(); +});