MCPcopy Index your code
hub / github.com/callstack/react-native-testing-library / createInstance

Function createInstance

src/user-event/setup/setup.ts:158–175  ·  view source on GitHub ↗
(config: UserEventConfig)

Source from the content-addressed store, hash-verified

156}
157
158function createInstance(config: UserEventConfig): UserEventInstance {
159 const instance = {
160 config,
161 } as UserEventInstance;
162
163 // Bind interactions to given User Event instance.
164 const api = {
165 press: wrapAndBindImpl(instance, press),
166 longPress: wrapAndBindImpl(instance, longPress),
167 type: wrapAndBindImpl(instance, type),
168 clear: wrapAndBindImpl(instance, clear),
169 paste: wrapAndBindImpl(instance, paste),
170 scrollTo: wrapAndBindImpl(instance, scrollTo),
171 };
172
173 Object.assign(instance, api);
174 return instance;
175}
176
177/**
178 * Wraps user interaction with `wrapAsync` (temporarily disable `act` environment while

Callers 1

setupFunction · 0.85

Calls 1

wrapAndBindImplFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…