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

Method forFilename

packages/jest-runtime/src/internals/cjsRequire.ts:97–110  ·  view source on GitHub ↗
(filename: string)

Source from the content-addressed store, hash-verified

95 }
96
97 forFilename(filename: string): NodeJS.Require {
98 return this.for(
99 {
100 children: [],
101 exports: {},
102 filename,
103 id: filename,
104 isPreloading: false,
105 loaded: false,
106 path: path.dirname(filename),
107 },
108 undefined,
109 );
110 }
111
112 private resolve(
113 from: string,

Callers 2

createRequireMethod · 0.80
cjsRequire.test.tsFile · 0.80

Calls 1

forMethod · 0.95

Tested by

no test coverage detected