Example #1
0
export async function worker({
  config,
  globalConfig,
  path,
  serializableModuleMap,
  context,
}: WorkerData): Promise<TestResult> {
  try {
    const moduleMap = serializableModuleMap
      ? HasteMap.ModuleMap.fromJSON(serializableModuleMap)
      : null;
    return await runTest(
      path,
      globalConfig,
      config,
      getResolver(config, moduleMap),
      context && {
        ...context,
        changedFiles: context.changedFiles && new Set(context.changedFiles),
      },
    );
  } catch (error) {
    throw formatError(error);
  }
}
Example #2
0
export async function worker({
  config,
  globalConfig,
  path,
  context,
}: WorkerData): Promise<TestResult> {
  try {
    return await runTest(
      path,
      globalConfig,
      config,
      getResolver(config),
      context && {
        ...context,
        changedFiles: context.changedFiles && new Set(context.changedFiles),
      },
    );
  } catch (error) {
    throw formatError(error);
  }
}