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

Update jest (main) #173227

Merged
merged 18 commits into from
Aug 26, 2024
Merged

Update jest (main) #173227

merged 18 commits into from
Aug 26, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Dec 12, 2023

Why was I pinged for review?

It looks like this new version is a bit more sensitive with the global jest.clearAllMocks(), jest.resetAllMocks(), and jest.restoreAllMocks().

My understanding after try-and-error is that spies are only cleared via jest.restoreAllMocks().


This PR contains the following updates:

Package Type Update Change
@jest/console (source) devDependencies minor ^29.6.1 -> ^29.7.0
@jest/reporters (source) devDependencies minor ^29.6.1 -> ^29.7.0
@jest/types (source) devDependencies patch ^29.6.1 -> ^29.6.3
babel-jest (source) devDependencies minor ^29.6.1 -> ^29.7.0
expect (source) devDependencies minor ^29.6.1 -> ^29.7.0
jest (source) devDependencies minor ^29.6.1 -> ^29.7.0
jest-cli (source) devDependencies minor ^29.6.1 -> ^29.7.0
jest-config (source) devDependencies minor ^29.6.1 -> ^29.7.0
jest-diff (source) devDependencies patch ^29.6.1 -> ^29.7.0
jest-environment-jsdom (source) devDependencies minor ^29.6.1 -> ^29.7.0
jest-matcher-utils (source) devDependencies minor ^29.6.1 -> ^29.7.0
jest-mock (source) devDependencies minor ^29.6.1 -> ^29.7.0
jest-runtime (source) devDependencies minor ^29.6.1 -> ^29.7.0
jest-snapshot (source) devDependencies minor ^29.6.1 -> ^29.7.0

Release Notes

jestjs/jest (@​jest/console)

v29.7.0

Compare Source

Features
  • [create-jest] Add npm init / yarn create initialiser for Jest projects (#​14465)
  • [jest-validate] Allow deprecation warnings for unknown options (#​14499)
Fixes
  • [jest-resolver] Replace unmatched capture groups in moduleNameMapper with empty string instead of undefined (#​14507)
  • [jest-snapshot] Allow for strings as well as template literals in inline snapshots (#​14465)
  • [@jest/test-sequencer] Calculate test runtime if perStats.duration is missing (#​14473)
Performance
  • [@jest/create-cache-key-function] Cache access of NODE_ENV and BABEL_ENV (#​14455)
Chore & Maintenance
  • [jest-cli] Move internal config initialisation logic to the create-jest package (#​14465)

v29.6.4

Compare Source

Fixes
  • [jest-core] Fix typo in scheduleAndRun performance marker (#​14434)
  • [jest-environment-node] Make sure atob and btoa are writeable in Node 20 (#​14446)
  • [jest-worker] Additional error wrapper for parentPort.postMessage to fix unhandled DataCloneError. (#​14437)

v29.6.3

Compare Source

Fixes
  • [expect, @​jest/expect-utils] ObjectContaining support sumbol as key (#​14414)
  • [expect] Remove @types/node from dependencies (#​14385)
  • [jest-core] Use workers in watch mode by default to avoid crashes (#​14059 & #​14085).
  • [jest-reporters] Update istanbul-lib-instrument dependency to v6. (#​14401)
  • [jest-mock] Revert #​13692 as it was a breaking change (#​14429)
  • [jest-mock] Revert #​13866 as it was a breaking change (#​14429)
  • [jest-mock] Revert #​13867 as it was a breaking change (#​14429)
  • [@jest/reporters] Marks Reporter's hooks as optional (#​14433)
  • [jest-runtime] Fix dynamic ESM import module bug when loaded module through jest.isolateModulesAsync (#​14397)
Chore & Maintenance
  • [jest-changed-files, jest-circus, jest-console, @​jest/core, @​jest/runtime, @​jest/transform] Use invariant and notEmpty from jest-util rather than own internal (#​14366)

v29.6.2

Compare Source

Fixes
  • [jest-circus] Fix snapshot matchers in concurrent tests when nr of tests exceeds maxConcurrency (#​14335)
  • [@jest/core] When running global setup and teardown, do not try to change the message property of the thrown error object when the message property is unwritable (#​14113)
  • [jest-snapshot] Move @types/prettier from dependencies to devDependencies (#​14328)
  • [jest-snapshot] Throw an explicit error if Prettier v3 is used (#​14367)
  • [jest-reporters] Add "skipped" and "todo" symbols to Github Actions Reporter (#​14309)
Chore & Maintenance
  • [@jest/core] Use pluralize from jest-util rather than own internal (#​14322)

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@renovate renovate bot added release_note:skip Skip the PR/issue when compiling release notes Team:Operations Team label for Operations Team labels Dec 12, 2023
@renovate renovate bot requested a review from a team December 12, 2023 21:57
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@renovate renovate bot force-pushed the renovate/main-jest branch from 101ee23 to a021ff6 Compare May 8, 2024 14:09
@patrykkopycinski
Copy link
Contributor

/ci

@renovate renovate bot force-pushed the renovate/main-jest branch 2 times, most recently from bbd7ece to d4c4b36 Compare June 28, 2024 15:45
@afharo
Copy link
Member

afharo commented Jun 28, 2024

/ci

1 similar comment
@afharo
Copy link
Member

afharo commented Jun 28, 2024

/ci

@afharo afharo enabled auto-merge (squash) June 28, 2024 23:18
@elastic-renovate-prod elastic-renovate-prod bot deleted a comment from renovate bot Aug 7, 2024
@afharo
Copy link
Member

afharo commented Aug 8, 2024

/ci

@elastic-renovate-prod
Copy link
Contributor

Edited/Blocked Notification

Renovate will not automatically rebase this PR, because it does not recognize the last commit author and assumes somebody else may have edited the PR.

You can manually request rebase by checking the rebase/retry box above.

⚠️ Warning: custom changes will be lost.

@afharo
Copy link
Member

afharo commented Aug 8, 2024

/ci

@delanni
Copy link
Contributor

delanni commented Aug 9, 2024

/ci

@afharo afharo requested review from a team as code owners August 9, 2024 18:56
@afharo afharo requested review from a team as code owners August 9, 2024 19:41
@afharo afharo requested a review from tiansivive August 9, 2024 19:41
Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

Response Ops changes LGTM

@afharo
Copy link
Member

afharo commented Aug 19, 2024

/ci

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.

Shared UX changes LGTM

@afharo
Copy link
Member

afharo commented Aug 23, 2024

/ci

@afharo afharo requested a review from a team as a code owner August 23, 2024 14:27
@botelastic botelastic bot added the Team:Fleet Team label for Observability Data Collection Fleet team label Aug 23, 2024
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@afharo
Copy link
Member

afharo commented Aug 23, 2024

/ci

@afharo
Copy link
Member

afharo commented Aug 23, 2024

/ci

Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

Fleet changes LGTM 🚀

Comment on lines +43 to +46
let createCloudSAMLSessionMock: jest.SpyInstance;
beforeEach(() => {
createCloudSAMLSessionMock = jest.spyOn(samlAuth, 'createCloudSAMLSession');
});
Copy link
Member

@dmlemeshko dmlemeshko Aug 26, 2024

Choose a reason for hiding this comment

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

@afharo totally fine with the change, but could you explain why it is required after update?
Is there something specific about createCloudSAMLSession function?

Copy link
Member

Choose a reason for hiding this comment

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

I couldn't find anything in the changelogs, but my observation in this PR is that jest changed (broke? 🤷) how spies are reset via the jest.reset/restoreAllMocks and the specific myMock.mockReset/Restore.

This means the pattern global spy + jest.reset/restoreAllMocks didn't work in some cases. I found that recreating the spy on each run was more stable (but lazy me, only changed it for those breaking the tests 😇)

Copy link
Member

Choose a reason for hiding this comment

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

only changed it for those breaking the tests

Thank you! I will update other tests later.

Copy link
Contributor

@tiansivive tiansivive left a comment

Choose a reason for hiding this comment

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

LGTM from Entity analytics

@afharo
Copy link
Member

afharo commented Aug 26, 2024

/ci

@kibana-ci
Copy link
Collaborator

kibana-ci commented Aug 26, 2024

💛 Build succeeded, but was flaky

  • Buildkite Build
  • Commit: 3c3a872
  • Kibana Serverless Image: docker.elastic.co/kibana-ci/kibana-serverless:pr-173227-3c3a87277108

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #57 / InfraOps App Metrics UI Hosts View #With data #Single Host Flyout Tabs Metadata Tab should render metadata tab, add and remove filter
  • [job] [logs] Jest Tests #17 / rules_list component empty hides MaintenanceWindowCallout if filterConsumers does not match the running maintenance window's category

The CI Stats report is too large to be displayed here, check out the CI build annotation for this information.

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@afharo afharo merged commit 1397256 into main Aug 26, 2024
51 checks passed
@afharo afharo deleted the renovate/main-jest branch August 26, 2024 14:43
@kibanamachine kibanamachine added v8.16.0 backport:skip This commit does not require backporting labels Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting ci:project-deploy-observability Create an Observability project release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team Team:obs-ux-management Observability Management User Experience Team Team:Operations Team label for Operations Team v8.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.