Skip to content

Commit

Permalink
Updates lp-requests to 4.2.2 (#158)
Browse files Browse the repository at this point in the history
* Updates lp-requests to 4.2.2

* Fix mocking service

Co-authored-by: Alejandro Reyes <[email protected]>
Co-authored-by: Conor Hawes <[email protected]>
  • Loading branch information
3 people authored Jun 14, 2022
1 parent b247d2e commit f152d6e
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 219 deletions.
4 changes: 3 additions & 1 deletion __mocks__/isomorphic-fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ const statuses = {
}

export default jest.fn(function(url, options) {
const payload = { ...options, url }
const response = {
// Response echoes back passed options
headers: {
get: () => {},
},
json: () => Promise.resolve({ ...options, url }),
text: () => Promise.resolve(JSON.stringify(payload)),
json: () => Promise.resolve(payload),
ok: !url.includes(failureUrl),
status: statuses[url],
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@launchpadlab/lp-hoc",
"version": "5.0.6",
"version": "5.0.7",
"description": "React HOCs",
"main": "lib/index.js",
"module": "esm/index.js",
Expand Down
Loading

0 comments on commit f152d6e

Please sign in to comment.