MCPcopy Create free account
hub / github.com/vuejs/test-utils / createWrapperError

Function createWrapperError

src/errorWrapper.ts:1–20  ·  view source on GitHub ↗
(
  wrapperType: 'DOMWrapper' | 'VueWrapper'
)

Source from the content-addressed store, hash-verified

1export function createWrapperError<T extends object>(
2 wrapperType: 'DOMWrapper' | 'VueWrapper'
3) {
4 return new Proxy<T>(Object.create(null), {
5 get(obj, prop) {
6 switch (prop) {
7 case 'then':
8 // allows for better errors when wrapping `find` in `await`
9 // https://github.com/vuejs/test-utils/issues/638
10 return
11 case 'exists':
12 return () => false
13 default:
14 throw new Error(
15 `Cannot call ${String(prop)} on an empty ${wrapperType}.`
16 )
17 }
18 }
19 })
20}

Callers 4

findFunction · 0.90
findComponentFunction · 0.90
constructorMethod · 0.90
findMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…