-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fetch-mock upgrade to 10.1.0 version #208702
Conversation
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]
History
|
Pinging @elastic/kibana-security (Team:Security) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Just left a couple of comments.
expect(fetchMock.lastOptions()).toMatchInlineSnapshot(` | ||
Object { | ||
"body": Promise {}, | ||
"method": "GET", | ||
} | ||
`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively, something like this works as well, if we want to avoid snapshots. However, I don't think it matters much in this case.
expect(fetchMock.lastOptions()).toEqual(expect.objectContaining({ method: 'GET' }))
@@ -338,7 +337,7 @@ describe('Fetch', () => { | |||
|
|||
const lastCall = fetchMock.lastCall(); | |||
|
|||
expect(lastCall!.request.credentials).toBe('same-origin'); | |||
expect(lastCall!.request!.credentials).toBe('same-origin'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Is there a reason to use the non-null operator here (and below) instead of just optional chaining?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It already head lastCall!.request
so I decided not to mix/change it, but I'm okay to change it as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Core changes LGTM!
Thanks for upgrading this package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM.
Starting backport for target branches: 9.0 |
## Summary Upgraded `fetch-mock` to 10.1.0 --------- Co-authored-by: Elastic Machine <[email protected]> (cherry picked from commit b62dff1)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `9.0`: - [fetch-mock upgrade to 10.1.0 version (#208702)](#208702) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Elena Shostak","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-01-31T12:41:20Z","message":"fetch-mock upgrade to 10.1.0 version (#208702)\n\n## Summary\r\n\r\nUpgraded `fetch-mock` to 10.1.0\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"b62dff1656c7cff02132ac9b29ca7dc93f50be40","branchLabelMapping":{"^v9.1.0$":"main","^v8.19.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Security","release_note:skip","backport:prev-minor","v9.1.0"],"title":"fetch-mock upgrade to 10.1.0 version","number":208702,"url":"https://github.com/elastic/kibana/pull/208702","mergeCommit":{"message":"fetch-mock upgrade to 10.1.0 version (#208702)\n\n## Summary\r\n\r\nUpgraded `fetch-mock` to 10.1.0\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"b62dff1656c7cff02132ac9b29ca7dc93f50be40"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/208702","number":208702,"mergeCommit":{"message":"fetch-mock upgrade to 10.1.0 version (#208702)\n\n## Summary\r\n\r\nUpgraded `fetch-mock` to 10.1.0\r\n\r\n---------\r\n\r\nCo-authored-by: Elastic Machine <[email protected]>","sha":"b62dff1656c7cff02132ac9b29ca7dc93f50be40"}}]}] BACKPORT--> Co-authored-by: Elena Shostak <[email protected]>
Summary
Upgraded
fetch-mock
to 10.1.0