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

Questions on skipTests behavior #889

Closed
sreich opened this issue Jun 19, 2024 · 3 comments · Fixed by #895
Closed

Questions on skipTests behavior #889

sreich opened this issue Jun 19, 2024 · 3 comments · Fixed by #895
Assignees
Labels

Comments

@sreich
Copy link

sreich commented Jun 19, 2024

According to docs: skipTests If this option is enabled, do not run any tests in dev mode. The default value is false.

What does behavior does this create exactly?

  • Does Dev mode by default run tests after every change? I thought that was only the hot tests command?

  • How about for first run on dev mode?

  • Does this effectively disable explicitly telling it to run tests, like when pressing the enter command?

@cherylking
Copy link
Member

cherylking commented Jun 19, 2024

@sreich All excellent questions which caused us to go back and look at how this design evolved over the years. Let me answer them here and then we will make some updates to the docs accordingly.

Does Dev mode by default run tests after every change? I thought that was only the hot tests command?

Tests are only run after every change if hotTests is set to true. The default for hotTests is false.

How about for first run on dev mode?

The first run of dev mode will not cause tests to run unless hotTests is set to true.

Does this effectively disable explicitly telling it to run tests, like when pressing the enter command?

Yes, setting skipTests to true disables the running of tests while in dev mode when pressing the enter key. It also overrides the setting for hotTests. So if hotTests is set to true and skipTests is set to true, then no tests will run either with the enter key or automatically after changes occur. The default for skipTests is false.

@cherylking
Copy link
Member

cherylking commented Jun 19, 2024

In addition to updating docs for this, we should make the following updates to the code:

  1. Do not print the message "To run tests on demand, press Enter." when skipTests has been set to true.
  2. Do not print the message "Tests will run automatically when changes are detected. You can also press the Enter key to run tests on demand." when hotTests is set to true and skipTests is also set to true.
  3. When the Enter key is pressed in dev mode and skipTests is set to true, print a message like "Tests will not run on demand because the skipTests parameter has been set to true."

It would also be a good idea to log a message when both skipTests and hotTests are set to true to warn the user that the hotTests configuration has been overridden and tests will not run automatically after changes occur.

@cherylking cherylking self-assigned this Jun 19, 2024
@sreich
Copy link
Author

sreich commented Jun 20, 2024

Excellent, this clears that up. And thank you for taking action items for improving the docs & especially the log messages! 😄

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

Successfully merging a pull request may close this issue.

3 participants