docs: document new webServer "ready" status codes (#14885)

Sync docs with implementation introduced via 30f3d526eb
This commit is contained in:
Ross Wollman 2022-06-15 09:00:29 -07:00 committed by GitHub
parent 259c8d64a5
commit 112a18e083
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -140,7 +140,7 @@ export const test = base.extend<{ saveLogs: void }>({
To launch a server during the tests, use the `webServer` option in the [configuration file](#configuration-object).
If `port` is specified in the config, test runner will wait for `127.0.0.1:port` or `::1:port` to be available before running the tests.
If `url` is specified in the config, test runner will wait for that `url` to return 2xx response before running the tests.
If `url` is specified in the config, test runner will wait for that `url` to return a 2xx, 3xx, 400, 401, 402, or 403 response before running the tests.
For continuous integration, you may want to use the `reuseExistingServer: !process.env.CI` option which does not use an existing server on the CI. To see the stdout, you can set the `DEBUG=pw:webserver` environment variable.

View file

@ -619,7 +619,7 @@ export default config;
- type: ?<[Object]>
- `command` <[string]> Shell command to start. For example `npm run start`..
- `port` ?<[int]> The port that your http server is expected to appear on. It does wait until it accepts connections. Exactly one of `port` or `url` is required.
- `url` ?<[string]> The url on your http server that is expected to return a 2xx status code when the server is ready to accept connections. Exactly one of `port` or `url` is required.
- `url` ?<[string]> The url on your http server that is expected to return a 2xx, 3xx, 400, 401, 402, or 403 status code when the server is ready to accept connections. Exactly one of `port` or `url` is required.
- `ignoreHTTPSErrors` ?<[boolean]> Whether to ignore HTTPS errors when fetching the `url`. Defaults to `false`.
- `timeout` ?<[int]> How long to wait for the process to start up and be available in milliseconds. Defaults to 60000.
- `reuseExistingServer` ?<[boolean]> If true, it will re-use an existing server on the `port` or `url` when available. If no server is running on that `port` or `url`, it will run the command to start a new server. If `false`, it will throw if an existing process is listening on the `port` or `url`. This should be commonly set to `!process.env.CI` to allow the local dev server when running tests locally.

View file

@ -4332,8 +4332,8 @@ interface TestConfigWebServer {
port?: number;
/**
* The url on your http server that is expected to return a 2xx status code when the server is ready to accept connections.
* Exactly one of `port` or `url` is required.
* The url on your http server that is expected to return a 2xx, 3xx, 400, 401, 402, or 403 status code when the server is
* ready to accept connections. Exactly one of `port` or `url` is required.
*/
url?: string;