You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// note: we get lazy with the types here, because the inference is bad anyway and this has a `void` return signature. The important bit is the parameter signature.
116
-
if (!mockedPath|| (!responsesasany)[mockedPath]) thrownewError(`No mocked response for ${req.url}`); // throw error if response not mocked (remove or modify if you’d like different behavior)
123
+
if (!mockedPath|| (!responsesasany)[mockedPath])
124
+
thrownewError(`No mocked response for ${req.url}`); // throw error if response not mocked (remove or modify if you’d like different behavior)
117
125
const method =req.method.toLowerCase();
118
-
if (!(responsesasany)[mockedPath][method]) thrownewError(`${req.method} called but not mocked on ${mockedPath}`); // likewise throw error if other parts of response aren’t mocked
126
+
if (!(responsesasany)[mockedPath][method])
127
+
thrownewError(`${req.method} called but not mocked on ${mockedPath}`); // likewise throw error if other parts of response aren’t mocked
119
128
if (!(responsesasany)[mockedPath][method]) {
120
129
thrownewError(`${req.method} called but not mocked on ${mockedPath}`);
121
130
}
122
131
const { status, body } = (responsesasany)[mockedPath][method];
123
132
return { status, body: JSON.stringify(body) };
124
-
})
133
+
});
125
134
}
126
135
127
136
// helper function that matches a realistic URL (/users/123) to an OpenAPI path (/users/{user_id}
0 commit comments