Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
courcelan committed Aug 6, 2024
1 parent 189cbf4 commit 341b027
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion __tests__/butter.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ test(
catch (error) {
await expect(error).toBeDefined();
await expect(error).toBeInstanceOf(Error);
await expect(error.message).toEqual("Error: Not found");
await expect(error.message).toEqual("Error: Not found (404)");
}

return
Expand Down
6 changes: 3 additions & 3 deletions lib/useButter.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ export default function useButter(type, butterConfig) {
const mappedParams = Object.fromEntries(
Object.entries(errorPayload.params)
.filter(([key]) => key !== 'auth_token')
)
);

const url = new URL(errorPayload.response.url)
const url = new URL(errorPayload.response.url);

// Remove auth_token from URL search params
url.searchParams.delete('auth_token');
Expand All @@ -142,7 +142,7 @@ export default function useButter(type, butterConfig) {
params: mappedParams,
type,
url
}
};

useOnError(
errorDetail,
Expand Down

0 comments on commit 341b027

Please sign in to comment.