MCPcopy
hub / github.com/jestjs/jest / resolveWatchPlugin

Function resolveWatchPlugin

packages/jest-resolve/src/utils.ts:133–152  ·  view source on GitHub ↗
(
  resolver: string | undefined | null,
  {
    filePath,
    rootDir,
    requireResolveFunction,
  }: {
    filePath: string;
    rootDir: string;
    requireResolveFunction: (moduleName: string) => string;
  },
)

Source from the content-addressed store, hash-verified

131 * 1. looks for <name> relative to Jest.
132 */
133export const resolveWatchPlugin = (
134 resolver: string | undefined | null,
135 {
136 filePath,
137 rootDir,
138 requireResolveFunction,
139 }: {
140 filePath: string;
141 rootDir: string;
142 requireResolveFunction: (moduleName: string) => string;
143 },
144): string =>
145 resolveWithPrefix(resolver, {
146 filePath,
147 humanOptionName: 'Watch plugin',
148 optionName: 'watchPlugins',
149 prefix: 'jest-watch-',
150 requireResolveFunction,
151 rootDir,
152 });
153
154/**
155 * Finds the runner to use:

Callers 1

normalizeFunction · 0.90

Calls 1

resolveWithPrefixFunction · 0.85

Tested by

no test coverage detected