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

test(ui-codemods): migrate old Codemods tests #1632

Conversation

git-nandor
Copy link
Contributor

Closes: INSTUI-4126

@git-nandor git-nandor self-assigned this Aug 8, 2024
@git-nandor git-nandor marked this pull request as ready for review August 8, 2024 17:34
Copy link

github-actions bot commented Aug 8, 2024

PR Preview Action v1.4.7
Preview removed because the pull request was closed.
2024-08-14 09:58 UTC

@git-nandor git-nandor force-pushed the INSTUI-4126_convert_old_codemods_jest_tests_to_the_new_format branch from 7f7594c to 7cf5f6b Compare August 9, 2024 13:06
…ook to transform ts files to js

Closes: INSTUI-4126

Pirates hook transform is a necessary workaround because vitest does not support importing ts files
with `require`.
@git-nandor git-nandor force-pushed the INSTUI-4126_convert_old_codemods_jest_tests_to_the_new_format branch from 7cf5f6b to 859bfb0 Compare August 9, 2024 14:28
Copy link
Collaborator

@matyasf matyasf left a comment

Choose a reason for hiding this comment

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

very nice work!

@@ -20,7 +20,7 @@ jobs:
- name: Set up project.
run: npm run bootstrap
- name: Run tests.
run: USE_REACT_STRICT_MODE=0 npm run test && npm run test:vitest && npm run test:jest && npm run cy:component
run: USE_REACT_STRICT_MODE=0 npm run test && npm run test:vitest && npm run cy:component
Copy link
Collaborator

Choose a reason for hiding this comment

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

we still have 1 Jest test suite in the ui package, but that will be converted to vitest next, so its OK that those tests are not running for a few builds.

Comment on lines +49 to +52
addHook(transformCode, {
exts: ['.ts', '.tsx'],
ignoreNodeModules: true
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

We are never unloading this hook. I guess its fine since tests are isolated https://vitest.dev/config/#isolate by default

Copy link
Contributor

@joyenjoyer joyenjoyer Aug 9, 2024

Choose a reason for hiding this comment

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

Yes, this is not an issue, we are running these tests separately from others.

@joyenjoyer joyenjoyer requested a review from balzss August 9, 2024 15:01
@git-nandor git-nandor requested a review from HerrTopi August 14, 2024 09:39
@git-nandor git-nandor merged commit 054d761 into master Aug 14, 2024
10 of 11 checks passed
@git-nandor git-nandor deleted the INSTUI-4126_convert_old_codemods_jest_tests_to_the_new_format branch August 14, 2024 09:58
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.

4 participants