MCPcopy Create free account
hub / github.com/testing-library/user-event / wrapAndBindImpl

Function wrapAndBindImpl

src/setup/setup.ts:126–143  ·  view source on GitHub ↗
(instance: Instance, impl: Impl)

Source from the content-addressed store, hash-verified

124}
125
126function wrapAndBindImpl<
127 Args extends unknown[],
128 Impl extends (this: Instance, ...args: Args) => Promise<unknown>,
129>(instance: Instance, impl: Impl) {
130 function method(...args: Args) {
131 setLevelRef(instance, ApiLevel.Call)
132
133 return wrapAsync(() =>
134 impl.apply(instance, args).then(async ret => {
135 await wait(instance.config)
136 return ret
137 }),
138 )
139 }
140 Object.defineProperty(method, 'name', {get: () => impl.name})
141
142 return method
143}
144
145export function createInstance(
146 config: Config,

Callers 1

createInstanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected