Fix OSS tests

Reviewed By: bestander

Differential Revision: D3088301

fb-gh-sync-id: 310d9c7c1956f21f3c8e5da6a1455c2a9fad2d04
shipit-source-id: 310d9c7c1956f21f3c8e5da6a1455c2a9fad2d04
This commit is contained in:
Mart?n Bigio 2016-03-23 15:16:46 -07:00 committed by Facebook Github Bot 9
parent ed654c022e
commit cccbb342a0
2 changed files with 9 additions and 6 deletions

View File

@ -41,16 +41,18 @@ describe('Bundler', function() {
isAsset, isAsset,
isAsset_DEPRECATED, isAsset_DEPRECATED,
isJSON, isJSON,
isPolyfill,
resolution, resolution,
}) { }) {
return { return {
path, path,
resolution, resolution,
getDependencies() { return Promise.resolve(dependencies); }, getDependencies: () => Promise.resolve(dependencies),
getName() { return Promise.resolve(id); }, getName: () => Promise.resolve(id),
isJSON() { return isJSON; }, isJSON: () => isJSON,
isAsset() { return isAsset; }, isAsset: () => isAsset,
isAsset_DEPRECATED() { return isAsset_DEPRECATED; }, isAsset_DEPRECATED: () => isAsset_DEPRECATED,
isPolyfill: () => isPolyfill,
read: () => ({ read: () => ({
code: 'arbitrary', code: 'arbitrary',
source: 'arbitrary', source: 'arbitrary',

View File

@ -388,8 +388,9 @@ class Bundler {
if (response.dependencies.length > 0) { if (response.dependencies.length > 0) {
const numModuleSystemDependencies = const numModuleSystemDependencies =
this._resolver.getModuleSystemDependencies({dev, unbundle}).length; this._resolver.getModuleSystemDependencies({dev, unbundle}).length;
entryFilePath = response.dependencies[ entryFilePath = response.dependencies[
response.numPrependedDependencies + (response.numPrependedDependencies || 0) +
numModuleSystemDependencies numModuleSystemDependencies
].path; ].path;
} }