Skip to content

Commit 4dffd13

Browse files
committed
fix(http): add some logging to mock request calling
1 parent 810fba7 commit 4dffd13

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/http/functions.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,7 @@ export function request(
272272
): Observable<HttpResponse> {
273273
if (is_mock()) {
274274
const request_obs = mock_handler(method, url, options?.body);
275-
if (request_obs) {
276-
return request_obs;
277-
}
275+
if (request_obs) return request_obs;
278276
}
279277
options.headers = options.headers || {};
280278
if (!options.headers['Content-Type'] && !options.headers['content-type']) {

src/http/mock.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ export function mockRequest(
9292
body?: any,
9393
handler_map: HashMap<MockHttpRequestHandler> = _handlers,
9494
): Observable<HashMap | string | void> | null {
95+
if (window.debug) {
96+
console.log('Resolving request:', method, url, body);
97+
}
9598
const handler = findRequestHandler(method, url, handler_map);
9699
if (handler) {
97100
const request = processRequest(url, handler, body);

0 commit comments

Comments
 (0)