-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Updating visual tests docs for 2.x versions #7827
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
base: dev-2.0
Are you sure you want to change the base?
Updating visual tests docs for 2.x versions #7827
Conversation
Hi @davepagurek @ksen0, while reviewing |
@@ -182,10 +186,9 @@ Here are the conventions and best practices that p5.js uses for unit tests which | |||
|
|||
## Running tests | |||
|
|||
The most straightforward way to run the tests is by using the `npm test` command in your terminal. However, `npm test` usually takes a long time to run simply because of the large number of test cases p5.js has. It can also sometimes be a bit repetitive to make some changes, run `npm test`, make some more changes, and run `npm test` again. Here are some tricks that can help streamline this process: | |||
The most straightforward way to run the tests is by using the `npm test` command in your terminal. However, `npm test` usually takes a long time to run simply because of the large number of test cases p5.js has. We don’t need to run `npm test` over and over after each change. As soon as we save our code, we can see in the browser or terminal whether the tests pass or not. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor/optional: maybe screenshots of what the terminal / other tests windows look like when they're open? The below docs (205:209) could also reference this diagram.
contributor_docs/unit_testing.md
Outdated
@@ -217,13 +224,11 @@ visualTest('2D objects maintain correct size', function(p5, screenshot) { | |||
}); | |||
``` | |||
|
|||
If you need to add a new test file, add it to that folder, then add the filename to the list in `test/visual/visualTestList.js`. Additionally, if you want that file to be run automatically as part of continuous integration on every pull request, add the filename to the `visual` list in `test/unit/spec.js`. | |||
No manual registration necessary. Any file placed in `test/unit/visual/cases` is auto-discovered by Vitest. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: "To add a new test file, place it into test/unit/visual/cases
. This will be auto-discovered by Vitest - no manual registration needed."
Thanks @ksen0 , I can work on your suggestion asap. :) |
Fixing docs for unit/visual testings.