Skip to content

Commit

Permalink
Add comment to explain fetch weirdness
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddyGuthridge committed Jun 23, 2024
1 parent 24b39d4 commit 58625ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/api/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,10 @@ export async function apiFetch (
}

// Got valid data
// Assign it to a new object, because otherwise it'll fail to match using
// `.toStrictEqual`, likely due to some weirdness with Jest
// Seems to be similar to the issues described at these URLs
// https://github.com/jestjs/jest/issues/8446
// https://github.com/nktnet1/jewire?tab=readme-ov-file#53-rewire-and-jest
return Object.assign({}, json);
}

0 comments on commit 58625ac

Please sign in to comment.