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

chore: Upgrade Jest packages to latest versions in /ui #4980

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

peruukki
Copy link
Contributor

@peruukki peruukki commented Jan 29, 2025

What this PR does / why we need it:

Upgrade Jest related packages to their latest versions. This is preparatory work to upgrade msw (whose old version causes security alerts due to vulnerable dependencies), which proved out to be impossible to do with older versions of Jest (at least for me). (I also tried switching from Jest to Vitest but had some mysterious failures with it too, may revisit it later.)

Which issue(s) this PR fixes:

None.

Misc

This was a long and winding road filled with desperation at times, so I should explain some changes:

  • The syntax for Jest transformers has changed, updated cssTransform.js accordingly
  • By default, we don't transform files in node_modules, but we now need to transform a couple dependencies, so we need to un-ignore them in transformIgnorePatterns in the Jest config:
    • @elastic/eui uses CSS keywords not understood by Jest
    • uuid is an ECMAScript module and needs to be transpiled to CommonJS to be understood by Jest
  • The transitive nwsapi dependency needs to be pinned to an older version in package.json because the newest versions fail to parse some CSS class names that Elastic UI generates. This workaround was suggested in Invalid selector with input:not([value='']) in 2.2.16 dperini/nwsapi#139 (comment)

@peruukki peruukki requested a review from a team as a code owner January 29, 2025 07:56
This is preparatory work to upgrade msw, which proved out to be
impossible to do (at least for me) with older versions of Jest.

Notes about the changes:

- The syntax for Jest transformers has changed, updated cssTransform.js
  accordingly

- By default, we don't transform files in node_modules, but we now need
  to transform a couple dependencies, so we need to un-ignore them in
  `transformIgnorePatterns` in the Jest config:

   - @elastic/eui uses CSS keywords not understood by Jest

   - uuid is an ECMAScript module and needs to be transpiled to CommonJS
     to be understood by Jest

- The transitive nwsapi dependency needs to be pinned to an older
  version in package.json since the newest versions fail to parse some
  CSS class names that Elastic UI generates. This workaround was
  suggested in dperini/nwsapi#139 (comment)

Signed-off-by: Harri Lehtola <[email protected]>
@redhatHameed redhatHameed merged commit 197a55f into feast-dev:master Jan 29, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants