Function
get
(target, property, receiver)
Source from the content-addressed store, hash-verified
| 31 | |
| 32 | return new Proxy(api, { |
| 33 | get(target, property, receiver) { |
| 34 | const value = Reflect.get(target, property, receiver) |
| 35 | |
| 36 | if ( |
| 37 | typeof property !== 'string' || |
| 38 | typeof value !== 'function' || |
| 39 | mockedMethods.has(property) |
| 40 | ) { |
| 41 | return value |
| 42 | } |
| 43 | |
| 44 | return () => |
| 45 | Promise.reject( |
| 46 | new Error(`No mock implementation registered for API.${property}`) |
| 47 | ) |
| 48 | }, |
| 49 | }) |
| 50 | } |
| 51 | |
Callers
nothing calls this directly
Tested by
no test coverage detected