Skip to content

Commit 27dd945

Browse files
committed
chore: adds logging to debug why tests not passing in ci
1 parent 7c74507 commit 27dd945

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test/helpers/rest.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,15 @@ export class RESTClient {
139139
}
140140

141141
const slug = args.slug || this.defaultSlug;
142-
const response = await fetch(`${this.serverURL}/api/${slug}`, options);
143-
const { status } = response;
144-
const { doc } = await response.json();
145-
return { status, doc };
142+
try {
143+
const response = await fetch(`${this.serverURL}/api/${slug}`, options);
144+
const { status } = response;
145+
const { doc } = await response.json();
146+
return { status, doc };
147+
} catch (err) {
148+
console.error(err);
149+
return { status: 500 };
150+
}
146151
}
147152

148153
async find<T = any>(args?: FindArgs): Promise<QueryResponse<T>> {

0 commit comments

Comments
 (0)