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

fix(HMS-3373): update msw and frontend-components-config #370

Merged
merged 1 commit into from
Jan 15, 2024

Conversation

amirfefer
Copy link
Member

@amirfefer amirfefer commented Jan 9, 2024

WIP

This PR update msw mocking server worker, which is used in our tests.
The msw (1.x -> 2.x) update is required for updating @redhat-cloud-services/frontend-components-config due to typescript peer dependent.

Comment on lines +8 to +9
* Consider migrating to a more modern test runner if
* you don't want to deal with this.
Copy link
Member

Choose a reason for hiding this comment

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

Huh? xD What does this mean? I guess its copied over, but do they mean more modern then Jest, or newer version of Jest?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think it's because we use jsdom in jest test env, we can pick a different test environment.

Copy link
Member

Choose a reason for hiding this comment

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

Up to you, I'll go with what you think is best solution, I was just curious ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

This polyfills file is taken from the official msw migration guide, so let's use it instead of replacing to a different test env :)

@@ -9,7 +9,7 @@ export COMPONENT_NAME="provisioning-frontend" # name of resourceTemplate compon
export IMAGE="quay.io/cloudservices/provisioning-frontend"
export WORKSPACE=${WORKSPACE:-$APP_ROOT} # if running in jenkins, use the build's workspace
export APP_ROOT=$(pwd)
# export NODE_BUILD_VERSION=16
export NODE_BUILD_VERSION=18
Copy link
Member

Choose a reason for hiding this comment

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

🧡 it, I'm not sure why it's not a default version already xD
I've just realized we'll need to add the same variable in the .rhcicd/build_deploy.sh to build main branch with the same version.

@amirfefer amirfefer changed the title build: update msw and frontend-components-config fix(HMS-3373): update msw and frontend-components-config Jan 11, 2024
"npm-run-all": "4.1.5",
"prop-types": "15.8.1",
"stylelint": "13.13.1",
"stylelint-config-recommended-scss": "4.3.0",
"stylelint-scss": "3.21.0",
"ts-patch": "^3.1.1",
"typescript": "^5.3.3",
"undici": "^5.0.0",
Copy link
Member Author

Choose a reason for hiding this comment

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

needs to be pin to version 5.x, there's an issue with axios and msw - mswjs/msw#1915

@amirfefer
Copy link
Member Author

tests seem to run faster :)

Copy link
Member

@ezr-ondrej ezr-ondrej left a comment

Choose a reason for hiding this comment

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

Nice! 🧡 Great work @amirfefer, thank you ! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants