Skip to content

Commit 540f23f

Browse files
committed
fix: fix test
1 parent 4081654 commit 540f23f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

apps/frontend/__tests__/question.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,12 +210,11 @@ describe("GetSingleQuestion", () => {
210210
const DOCREF = "mockdocref";
211211
beforeEach(() => {
212212
global.fetch = jest.fn().mockResolvedValue({
213+
ok: true, // // Ensure `ok` is true to hit the success branch
213214
async json() {
214215
return QUESTIONS[0]
215216
},
216-
async text() {
217-
return 'mocked response'
218-
}
217+
text: () => Promise.resolve('mocked response'),
219218
});
220219
});
221220

0 commit comments

Comments
 (0)