From cccbb342a046ccc61ca778f1f1ac294db25edd6a Mon Sep 17 00:00:00 2001 From: Mart?n Bigio Date: Wed, 23 Mar 2016 15:16:46 -0700 Subject: [PATCH] Fix OSS tests Reviewed By: bestander Differential Revision: D3088301 fb-gh-sync-id: 310d9c7c1956f21f3c8e5da6a1455c2a9fad2d04 shipit-source-id: 310d9c7c1956f21f3c8e5da6a1455c2a9fad2d04 --- react-packager/src/Bundler/__tests__/Bundler-test.js | 12 +++++++----- react-packager/src/Bundler/index.js | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/react-packager/src/Bundler/__tests__/Bundler-test.js b/react-packager/src/Bundler/__tests__/Bundler-test.js index 4ee7f110..ac5cc0bd 100644 --- a/react-packager/src/Bundler/__tests__/Bundler-test.js +++ b/react-packager/src/Bundler/__tests__/Bundler-test.js @@ -41,16 +41,18 @@ describe('Bundler', function() { isAsset, isAsset_DEPRECATED, isJSON, + isPolyfill, resolution, }) { return { path, resolution, - getDependencies() { return Promise.resolve(dependencies); }, - getName() { return Promise.resolve(id); }, - isJSON() { return isJSON; }, - isAsset() { return isAsset; }, - isAsset_DEPRECATED() { return isAsset_DEPRECATED; }, + getDependencies: () => Promise.resolve(dependencies), + getName: () => Promise.resolve(id), + isJSON: () => isJSON, + isAsset: () => isAsset, + isAsset_DEPRECATED: () => isAsset_DEPRECATED, + isPolyfill: () => isPolyfill, read: () => ({ code: 'arbitrary', source: 'arbitrary', diff --git a/react-packager/src/Bundler/index.js b/react-packager/src/Bundler/index.js index f32150c2..8d630528 100644 --- a/react-packager/src/Bundler/index.js +++ b/react-packager/src/Bundler/index.js @@ -388,8 +388,9 @@ class Bundler { if (response.dependencies.length > 0) { const numModuleSystemDependencies = this._resolver.getModuleSystemDependencies({dev, unbundle}).length; + entryFilePath = response.dependencies[ - response.numPrependedDependencies + + (response.numPrependedDependencies || 0) + numModuleSystemDependencies ].path; }