Skip to content

Commit f152d6e

Browse files
aalejandromrAlejandro Reyeschawes13
authored
Updates lp-requests to 4.2.2 (#158)
* Updates lp-requests to 4.2.2 * Fix mocking service Co-authored-by: Alejandro Reyes <aalejandromr@Alejandros-MacBook-Pro.local> Co-authored-by: Conor Hawes <conor@launchpadlab.com>
1 parent b247d2e commit f152d6e

File tree

3 files changed

+73
-219
lines changed

3 files changed

+73
-219
lines changed

__mocks__/isomorphic-fetch.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ const statuses = {
77
}
88

99
export default jest.fn(function(url, options) {
10+
const payload = { ...options, url }
1011
const response = {
1112
// Response echoes back passed options
1213
headers: {
1314
get: () => {},
1415
},
15-
json: () => Promise.resolve({ ...options, url }),
16+
text: () => Promise.resolve(JSON.stringify(payload)),
17+
json: () => Promise.resolve(payload),
1618
ok: !url.includes(failureUrl),
1719
status: statuses[url],
1820
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@launchpadlab/lp-hoc",
3-
"version": "5.0.6",
3+
"version": "5.0.7",
44
"description": "React HOCs",
55
"main": "lib/index.js",
66
"module": "esm/index.js",

0 commit comments

Comments
 (0)