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: convenient script to filter tests #6787

Closed
wants to merge 6 commits into from
Closed

Conversation

KSXGitHub
Copy link
Contributor

so that we don't need to edit the source code (adding .only to the test file and file path to the script) and the undo it over and over again.

@KSXGitHub KSXGitHub requested a review from zkochan as a code owner July 10, 2023 07:59
/* eslint-disable @typescript-eslint/restrict-template-expressions */

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't remember making this change.

@zkochan
Copy link
Member

zkochan commented Jul 10, 2023

Could you describe in CONTRIBUTING.md how to run a single test in some project using this new script?

@@ -144,9 +144,11 @@
"registry-mock": "registry-mock",
"test:jest": "jest",
"test:e2e": "registry-mock prepare && run-p -r registry-mock test:jest",
"filtered-test:jest": "sh -o nounset -c 'jest --verbose --testPathPattern \"$TEST_PATH_PATTERN\" --testNamePattern \"$TEST_NAME_PATTERN\"'",
Copy link
Member

Choose a reason for hiding this comment

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

How would this work? The registry-mock is not started.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So that why successful offline installation test didn't finish!

Anyway, with the latest commits, I have merged filtered-test into test. The environment variables have been made optional.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also, since I merge filterered-test into test, test now requires sh even on Windows. Do you prefer creating a JavaScript file to spawn the test cross-platform?

@zkochan
Copy link
Member

zkochan commented Jul 15, 2023

I have found the right way to do this, using jest's setup and teardown scripts: #6813

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.

None yet

2 participants