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

Function registerContext

packages/spy/src/index.ts:603–607  ·  view source on GitHub ↗
(context: MockProcedureContext<Procedure>, state: MockContext, prototypeState?: MockContext)

Source from the content-addressed store, hash-verified

601}
602
603function registerContext(context: MockProcedureContext<Procedure>, state: MockContext, prototypeState?: MockContext) {
604 const contextIndex = state.contexts.push(context)
605 const contextPrototypeIndex = prototypeState?.contexts.push(context)
606 return [contextIndex, contextPrototypeIndex] as const
607}
608
609function copyOriginalStaticProperties(mock: Mock<Procedure | Constructable>, original: Procedure | Constructable) {
610 const { properties, descriptors } = getAllProperties(original)

Callers 1

createMockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected