Skip to content
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

Merged
merged 5 commits into from
Jan 31, 2025

Conversation

elena-shostak
Copy link
Contributor

@elena-shostak elena-shostak commented Jan 29, 2025

Summary

Upgraded fetch-mock to 10.1.0

@elena-shostak elena-shostak added Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! release_note:skip Skip the PR/issue when compiling release notes backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) labels Jan 29, 2025
@elena-shostak
Copy link
Contributor Author

@elasticmachine merge upstream

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

@elena-shostak elena-shostak marked this pull request as ready for review January 30, 2025 08:56
@elena-shostak elena-shostak requested review from a team as code owners January 30, 2025 08:56
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-security (Team:Security)

Copy link
Contributor

@jeramysoucy jeramysoucy left a 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.

Comment on lines +70 to +75
expect(fetchMock.lastOptions()).toMatchInlineSnapshot(`
Object {
"body": Promise {},
"method": "GET",
}
`);
Copy link
Contributor

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');
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Member

@afharo afharo left a 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

Copy link
Contributor

@eokoneyo eokoneyo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes LGTM.

@elena-shostak elena-shostak merged commit b62dff1 into elastic:main Jan 31, 2025
8 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 9.0

https://github.com/elastic/kibana/actions/runs/13072961888

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jan 31, 2025
## Summary

Upgraded `fetch-mock` to 10.1.0

---------

Co-authored-by: Elastic Machine <[email protected]>
(cherry picked from commit b62dff1)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
9.0

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jan 31, 2025
# 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-minor Backport to (9.0) the previous minor version (i.e. one version back from main) release_note:skip Skip the PR/issue when compiling release notes Team:Security Team focused on: Auth, Users, Roles, Spaces, Audit Logging, and more! v9.0.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants