Remove "--disable-global-cache" from the internal CLI

Reviewed By: davidaurelio

Differential Revision: D7774252

fbshipit-source-id: c398aed714365f1f1010ae76b06dc5ad0fa78c22
This commit is contained in:
Miguel Jimenez Esun 2018-04-26 12:04:00 -07:00 committed by Facebook Github Bot
parent fc9bd150e3
commit b6494d8f81
3 changed files with 4 additions and 7 deletions

View File

@ -16,6 +16,8 @@ const HttpStore = require('./stores/HttpStore');
const stableHash = require('./stableHash'); 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'; export type {CacheStore} from './types.flow';
module.exports.Cache = Cache; module.exports.Cache = Cache;

View File

@ -12,7 +12,6 @@
jest.useRealTimers(); jest.useRealTimers();
jest jest
.mock('../../lib/TransformCaching')
// It's noticeably faster to prevent running watchman from FileWatcher. // It's noticeably faster to prevent running watchman from FileWatcher.
.mock('child_process', () => ({})) .mock('child_process', () => ({}))
.mock('os', () => ({ .mock('os', () => ({
@ -128,11 +127,11 @@ describe('traverseDependencies', function() {
assetExts: ['png', 'jpg'], assetExts: ['png', 'jpg'],
// This pattern is not expected to match anything. // This pattern is not expected to match anything.
blacklistRE: /.^/, blacklistRE: /.^/,
cacheStores: [],
providesModuleNodeModules: ['haste-fbjs', 'react-haste', 'react-native'], providesModuleNodeModules: ['haste-fbjs', 'react-haste', 'react-native'],
platforms: new Set(['ios', 'android']), platforms: new Set(['ios', 'android']),
maxWorkers: 1, maxWorkers: 1,
resetCache: true, resetCache: true,
transformCache: require('TransformCaching').mocked(),
transformCode: (module, sourceCode, transformOptions) => { transformCode: (module, sourceCode, transformOptions) => {
return new Promise(resolve => { return new Promise(resolve => {
// require call must stay inline, so the latest defined mock is used! // require call must stay inline, so the latest defined mock is used!

View File

@ -10,14 +10,11 @@
'use strict'; 'use strict';
jest jest.mock('fs', () => new (require('metro-memory-fs'))());
.mock('fs', () => new (require('metro-memory-fs'))())
.mock('../../lib/TransformCaching');
const AssetModule = require('../AssetModule'); const AssetModule = require('../AssetModule');
const DependencyGraphHelpers = require('../DependencyGraph/DependencyGraphHelpers'); const DependencyGraphHelpers = require('../DependencyGraph/DependencyGraphHelpers');
const ModuleCache = require('../ModuleCache'); const ModuleCache = require('../ModuleCache');
const TransformCaching = require('../../lib/TransformCaching');
const fs = require('fs'); const fs = require('fs');
describe('AssetModule:', () => { describe('AssetModule:', () => {
@ -43,7 +40,6 @@ describe('AssetModule:', () => {
getTransformCacheKey: () => 'foo', getTransformCacheKey: () => 'foo',
localPath: 'image.png', localPath: 'image.png',
moduleCache: new ModuleCache({}), moduleCache: new ModuleCache({}),
options: {transformCache: TransformCaching.mocked()},
transformCode: () => { transformCode: () => {
return Promise.resolve({code: 'module.exports = "asset";'}); return Promise.resolve({code: 'module.exports = "asset";'});
}, },