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

Function longPress

src/user-event/press/press.ts:36–49  ·  view source on GitHub ↗
(
  this: UserEventInstance,
  instance: TestInstance,
  options?: PressOptions,
)

Source from the content-addressed store, hash-verified

34}
35
36export async function longPress(
37 this: UserEventInstance,
38 instance: TestInstance,
39 options?: PressOptions,
40): Promise<void> {
41 if (!isTestInstance(instance)) {
42 throw new ErrorWithStack(`longPress() works only with host instances.`, longPress);
43 }
44
45 await basePress(this.config, instance, {
46 type: 'longPress',
47 duration: options?.duration ?? DEFAULT_LONG_PRESS_DELAY_MS,
48 });
49}
50
51interface BasePressOptions {
52 type: 'press' | 'longPress';

Callers

nothing calls this directly

Calls 2

isTestInstanceFunction · 0.90
basePressFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…