From b6494d8f81b1962b74a6e64e08d3a716f734d492 Mon Sep 17 00:00:00 2001 From: Miguel Jimenez Esun Date: Thu, 26 Apr 2018 12:04:00 -0700 Subject: [PATCH] Remove "--disable-global-cache" from the internal CLI Reviewed By: davidaurelio Differential Revision: D7774252 fbshipit-source-id: c398aed714365f1f1010ae76b06dc5ad0fa78c22 --- packages/metro-cache/src/index.js | 2 ++ .../__tests__/traverseDependencies-integration-test.js | 3 +-- packages/metro/src/node-haste/__tests__/AssetModule-test.js | 6 +----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/packages/metro-cache/src/index.js b/packages/metro-cache/src/index.js index ddc33dc7..d0a0602a 100644 --- a/packages/metro-cache/src/index.js +++ b/packages/metro-cache/src/index.js @@ -16,6 +16,8 @@ const HttpStore = require('./stores/HttpStore'); const stableHash = require('./stableHash'); +export type {Options as FileOptions} from './stores/FileStore'; +export type {Options as HttpOptions} from './stores/HttpStore'; export type {CacheStore} from './types.flow'; module.exports.Cache = Cache; diff --git a/packages/metro/src/DeltaBundler/__tests__/traverseDependencies-integration-test.js b/packages/metro/src/DeltaBundler/__tests__/traverseDependencies-integration-test.js index 33ac488b..f14f46a2 100644 --- a/packages/metro/src/DeltaBundler/__tests__/traverseDependencies-integration-test.js +++ b/packages/metro/src/DeltaBundler/__tests__/traverseDependencies-integration-test.js @@ -12,7 +12,6 @@ jest.useRealTimers(); jest - .mock('../../lib/TransformCaching') // It's noticeably faster to prevent running watchman from FileWatcher. .mock('child_process', () => ({})) .mock('os', () => ({ @@ -128,11 +127,11 @@ describe('traverseDependencies', function() { assetExts: ['png', 'jpg'], // This pattern is not expected to match anything. blacklistRE: /.^/, + cacheStores: [], providesModuleNodeModules: ['haste-fbjs', 'react-haste', 'react-native'], platforms: new Set(['ios', 'android']), maxWorkers: 1, resetCache: true, - transformCache: require('TransformCaching').mocked(), transformCode: (module, sourceCode, transformOptions) => { return new Promise(resolve => { // require call must stay inline, so the latest defined mock is used! diff --git a/packages/metro/src/node-haste/__tests__/AssetModule-test.js b/packages/metro/src/node-haste/__tests__/AssetModule-test.js index f0bdc7d0..16e4fc04 100644 --- a/packages/metro/src/node-haste/__tests__/AssetModule-test.js +++ b/packages/metro/src/node-haste/__tests__/AssetModule-test.js @@ -10,14 +10,11 @@ 'use strict'; -jest - .mock('fs', () => new (require('metro-memory-fs'))()) - .mock('../../lib/TransformCaching'); +jest.mock('fs', () => new (require('metro-memory-fs'))()); const AssetModule = require('../AssetModule'); const DependencyGraphHelpers = require('../DependencyGraph/DependencyGraphHelpers'); const ModuleCache = require('../ModuleCache'); -const TransformCaching = require('../../lib/TransformCaching'); const fs = require('fs'); describe('AssetModule:', () => { @@ -43,7 +40,6 @@ describe('AssetModule:', () => { getTransformCacheKey: () => 'foo', localPath: 'image.png', moduleCache: new ModuleCache({}), - options: {transformCache: TransformCaching.mocked()}, transformCode: () => { return Promise.resolve({code: 'module.exports = "asset";'}); },