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

Function assertDescriptor

src/keyboard/getNextKeyDef.ts:175–183  ·  view source on GitHub ↗
(
  descriptor: string | undefined,
  text: string,
  pos: number,
)

Source from the content-addressed store, hash-verified

173}
174
175function assertDescriptor(
176 descriptor: string | undefined,
177 text: string,
178 pos: number,
179): asserts descriptor is string {
180 if (!descriptor) {
181 throw new Error(getErrorMessage('key descriptor', text[pos], text))
182 }
183}
184
185function getEnumValue<T>(f: Record<string, T>, key: string): T | undefined {
186 return f[key]

Callers 2

readPrintableCharFunction · 0.85
readTagFunction · 0.85

Calls 1

getErrorMessageFunction · 0.85

Tested by

no test coverage detected