From d072af955822662ca9aa11c37bb8787643b91ee8 Mon Sep 17 00:00:00 2001 From: sm2017 Date: Sun, 29 Oct 2017 14:55:01 +0330 Subject: [PATCH 1/4] Update Blob.js --- Libraries/Blob/Blob.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Blob/Blob.js b/Libraries/Blob/Blob.js index 590f48fc50dc..f7711850571f 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) => { From 63f94ff2e1d1912f53623254ff8157ef7aab3d4b Mon Sep 17 00:00:00 2001 From: sm2017 Date: Mon, 13 Nov 2017 09:34:06 +0330 Subject: [PATCH 2/4] Update Blob.js --- Libraries/Blob/Blob.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/Blob/Blob.js b/Libraries/Blob/Blob.js index f7711850571f..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) => { From b4a471b50444ad915f7c7d129fd8ed586052809f Mon Sep 17 00:00:00 2001 From: sm2017 Date: Wed, 15 Nov 2017 12:18:46 +0330 Subject: [PATCH 3/4] Create Blob-test.js Unit test --- Libraries/Blob/__tests__/Blob-test.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Libraries/Blob/__tests__/Blob-test.js diff --git a/Libraries/Blob/__tests__/Blob-test.js b/Libraries/Blob/__tests__/Blob-test.js new file mode 100644 index 000000000000..2657f942320d --- /dev/null +++ b/Libraries/Blob/__tests__/Blob-test.js @@ -0,0 +1,24 @@ +/** + * 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', () => { + let blob; + + try { + new Blob(); + blob = true; + } catch (e) { + blob = false; + } + + expect(blob).toBe(true); +}); From 56a4b676360bd5ff65a1c813fbd89cf691c81e73 Mon Sep 17 00:00:00 2001 From: sm2017 Date: Tue, 12 Dec 2017 19:44:31 +0330 Subject: [PATCH 4/4] Update Blob-test.js --- Libraries/Blob/__tests__/Blob-test.js | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Libraries/Blob/__tests__/Blob-test.js b/Libraries/Blob/__tests__/Blob-test.js index 2657f942320d..c9f42e4418cd 100644 --- a/Libraries/Blob/__tests__/Blob-test.js +++ b/Libraries/Blob/__tests__/Blob-test.js @@ -11,14 +11,5 @@ test('Blob construct', () => { - let blob; - - try { - new Blob(); - blob = true; - } catch (e) { - blob = false; - } - - expect(blob).toBe(true); + expect(() => new Blob()).not.toThrow(); });