mirror of https://github.com/status-im/metro.git
Fix DependencyGraph-test log-spew
Reviewed By: mjesun Differential Revision: D5803016 fbshipit-source-id: fc94590331fb77796cb5d2bbc96f963b7b5f8c7c
This commit is contained in:
parent
86a943bbcd
commit
92fa17f70e
|
@ -77,14 +77,14 @@ class Resolver {
|
||||||
}
|
}
|
||||||
|
|
||||||
static async load(opts: Options): Promise<Resolver> {
|
static async load(opts: Options): Promise<Resolver> {
|
||||||
const depGraphOpts = {
|
const depGraph = await DependencyGraph.load({
|
||||||
assetDependencies: [opts.assetRegistryPath],
|
assetDependencies: [opts.assetRegistryPath],
|
||||||
assetExts: opts.assetExts,
|
assetExts: opts.assetExts,
|
||||||
extraNodeModules: opts.extraNodeModules,
|
extraNodeModules: opts.extraNodeModules,
|
||||||
forceNodeFilesystemAPI: false,
|
forceNodeFilesystemAPI: false,
|
||||||
getTransformCacheKey: opts.getTransformCacheKey,
|
getTransformCacheKey: opts.getTransformCacheKey,
|
||||||
globalTransformCache: opts.globalTransformCache,
|
globalTransformCache: opts.globalTransformCache,
|
||||||
ignoreFilePath: opts.blacklistRE || / ^/ /* matches nothing */,
|
ignorePattern: opts.blacklistRE || / ^/ /* matches nothing */,
|
||||||
maxWorkers: opts.maxWorkers,
|
maxWorkers: opts.maxWorkers,
|
||||||
moduleOptions: {
|
moduleOptions: {
|
||||||
hasteImpl: opts.hasteImpl,
|
hasteImpl: opts.hasteImpl,
|
||||||
|
@ -101,8 +101,7 @@ class Resolver {
|
||||||
transformCode: opts.transformCode,
|
transformCode: opts.transformCode,
|
||||||
useWatchman: true,
|
useWatchman: true,
|
||||||
watch: opts.watch,
|
watch: opts.watch,
|
||||||
};
|
});
|
||||||
const depGraph = await DependencyGraph.load(depGraphOpts);
|
|
||||||
return new Resolver(opts, depGraph);
|
return new Resolver(opts, depGraph);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@ type Options = {|
|
||||||
+forceNodeFilesystemAPI: boolean,
|
+forceNodeFilesystemAPI: boolean,
|
||||||
+getTransformCacheKey: GetTransformCacheKey,
|
+getTransformCacheKey: GetTransformCacheKey,
|
||||||
+globalTransformCache: ?GlobalTransformCache,
|
+globalTransformCache: ?GlobalTransformCache,
|
||||||
+ignoreFilePath: RegExp,
|
+ignorePattern: RegExp,
|
||||||
+maxWorkers: number,
|
+maxWorkers: number,
|
||||||
+moduleOptions: ModuleOptions,
|
+moduleOptions: ModuleOptions,
|
||||||
+platforms: Set<string>,
|
+platforms: Set<string>,
|
||||||
|
@ -108,7 +108,7 @@ class DependencyGraph extends EventEmitter {
|
||||||
return new JestHasteMap({
|
return new JestHasteMap({
|
||||||
extensions: opts.sourceExts.concat(opts.assetExts),
|
extensions: opts.sourceExts.concat(opts.assetExts),
|
||||||
forceNodeFilesystemAPI: opts.forceNodeFilesystemAPI,
|
forceNodeFilesystemAPI: opts.forceNodeFilesystemAPI,
|
||||||
ignorePattern: opts.ignoreFilePath,
|
ignorePattern: opts.ignorePattern,
|
||||||
maxWorkers: opts.maxWorkers,
|
maxWorkers: opts.maxWorkers,
|
||||||
mocksPattern: '',
|
mocksPattern: '',
|
||||||
name: 'metro-bundler-' + JEST_HASTE_MAP_CACHE_BREAKER,
|
name: 'metro-bundler-' + JEST_HASTE_MAP_CACHE_BREAKER,
|
||||||
|
|
|
@ -102,7 +102,8 @@ describe('DependencyGraph', function() {
|
||||||
providesModuleNodeModules: ['haste-fbjs', 'react-haste', 'react-native'],
|
providesModuleNodeModules: ['haste-fbjs', 'react-haste', 'react-native'],
|
||||||
platforms: new Set(['ios', 'android']),
|
platforms: new Set(['ios', 'android']),
|
||||||
useWatchman: false,
|
useWatchman: false,
|
||||||
ignoreFilePath: () => false,
|
// This pattern is not expected to match anything.
|
||||||
|
ignorePattern: /🚇/,
|
||||||
maxWorkers: 1,
|
maxWorkers: 1,
|
||||||
moduleOptions: {transformCache: require('TransformCaching').mocked()},
|
moduleOptions: {transformCache: require('TransformCaching').mocked()},
|
||||||
resetCache: true,
|
resetCache: true,
|
||||||
|
|
Loading…
Reference in New Issue