Function
getResBodyJSONTypes
(
store: RequestStore,
host: string,
path: string,
propName = testKey
)
Source from the content-addressed store, hash-verified
| 28 | const contentBoolTest = JSON.stringify(testBoolObj); |
| 29 | |
| 30 | const getResBodyJSONTypes = ( |
| 31 | store: RequestStore, |
| 32 | host: string, |
| 33 | path: string, |
| 34 | propName = testKey |
| 35 | ) => { |
| 36 | const match = store.get()[host]?.lookup(path); |
| 37 | if (!match) throw new Error("Could not match path"); |
| 38 | const properties = |
| 39 | match.data.methods[POST]?.response?.[200]?.["application/json"]?.body |
| 40 | ?.properties?.[propName]?.type || undefined; |
| 41 | return properties; |
| 42 | }; |
| 43 | |
| 44 | it("parameterises and merges paths", () => { |
| 45 | const store = new RequestStore(); |
Tested by
no test coverage detected