Fix documentation based on feedback from PR review.

This commit is contained in:
Alex López 2023-09-07 13:56:38 +02:00
parent 30e2437d43
commit 6dc7b83c9c
3 changed files with 9 additions and 9 deletions

View File

@ -37,9 +37,9 @@ Please take a moment to review the [project readme](https://github.com/woocommer
- Run our build process described in the document on [how to set up WooCommerce development environment](https://github.com/woocommerce/woocommerce/wiki/How-to-set-up-WooCommerce-development-environment), it will install our pre-commit hook, code sniffs, dependencies, and more.
- Before pushing commits to GitHub, check your code against our code standards. For PHP code in the WooCommerce Core project you can do this by running `pnpm --filter=woocommerce run lint:php:changes:branch`.
- Whenever possible, please fix pre-existing code standards errors in code that you change.
- Please consider adding appropriate tests related to your change if applicable such as unit, API and E2E. You can check the following guides for this purpose:
- [Writing unit tests](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/tests/README.md#writing-tests).
- [Writing API tests](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/tests/api-core-tests#guide-for-writing-tests).
- Please consider adding appropriate tests related to your change if applicable such as unit, API and E2E tests. You can check the following guides for this purpose:
- [Writing unit tests](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/tests/README.md#guide-for-writing-unit-tests).
- [Writing API tests](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/tests/api-core-tests#guide-for-writing-api-tests).
- [Writing E2E tests](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/tests/e2e-pw#guide-for-writing-e2e-tests).
- Ensure you use LF line endings in your code editor. Use [EditorConfig](http://editorconfig.org/) if your editor supports it so that indentation, line endings and other settings are auto configured.
- When committing, reference your issue number (#1234) and include a note about the fix.

View File

@ -9,10 +9,10 @@ This document discusses unit tests. See [the e2e README](https://github.com/wooc
- [Initial Setup](#initial-setup)
- [MySQL database](#mysql-database)
- [Setup instructions](#setup-instructions)
- [Running Tests](#running-tests)
- [Running Unit Tests](#running-unit-tests)
- [Troubleshooting](#troubleshooting)
- [Running tests in PHP 8](#running-tests-in-php-8)
- [Writing Tests](#writing-tests)
- [Guide for Writing Unit Tests](#guide-for-writing-unit-tests)
- [Automated Tests](#automated-tests)
- [Code Coverage](#code-coverage)
@ -51,7 +51,7 @@ Example:
**Important**: The `<db-name>` database will be created if it doesn't exist and all data will be removed during testing.
## Running Tests
## Running Unit Tests
Change to the plugin root directory and type:
@ -97,7 +97,7 @@ $ tests/bin/install.sh woocommerce_tests_1 root root
Note that `woocommerce_tests` changed to `woocommerce_tests_1` as the `woocommerce_tests` database already exists due to the prior command.
## Writing Tests
## Guide for Writing Unit Tests
There are three different unit test directories:

View File

@ -8,7 +8,7 @@ This package contains automated API tests for WooCommerce, based on Playwright a
- [Introduction](#introduction)
- [About the Environment](#about-the-environment)
- [Test Variables](#test-variables)
- [Guide for writing tests](#guide-for-writing-tests)
- [Guide for writing API tests](#guide-for-writing-api-tests)
- [What aspects of the API should we test?](#what-aspects-of-the-api-should-we-test)
- [Creating test structure](#creating-test-structure)
- [Test Data Setup/Teardown](#test-data-setupteardown)
@ -130,7 +130,7 @@ After you run a test, it's best to restart the environment to start from a fresh
- `pnpm env:destroy` when you make changes to `.wp-env.json`
- `pnpm env:test` to spin up the test environment
## Guide for writing tests
## Guide for writing API tests
When writing new tests, a good source on how to get started is to reference the [existing tests](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/tests/api-core-tests/tests). Data that is required for the tests should be located in an equivalent file in the [data](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/tests/api-core-tests/data) folder.