MCPcopy
hub / github.com/vitest-dev/vitest / resolve

Function resolve

test/coverage-test/setup.native.ts:5–11  ·  view source on GitHub ↗
(specifier, context, nextResolve)

Source from the content-addressed store, hash-verified

3
4 registerHooks({
5 resolve(specifier, context, nextResolve) {
6 if (context.parentURL && specifier.startsWith('.') && !/\.[a-z]+$/.test(specifier) && !context.parentURL.includes('/node_modules/')) {
7 specifier += '.ts'
8 }
9
10 return nextResolve(specifier, context)
11 },
12 })
13}
14

Callers 15

runVitestFunction · 0.70
normalizeFilenameFunction · 0.70
openMethod · 0.50
readMethod · 0.50
listenerFunction · 0.50
basic.test.tsFile · 0.50
resolvePathFunction · 0.50
useFSFunction · 0.50
runInlineTestsFunction · 0.50

Calls 1

testMethod · 0.45

Tested by 4

openMethod · 0.40
readMethod · 0.40
listenerFunction · 0.40
updateThresholdsFunction · 0.40