Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenewald authored Apr 30, 2023
1 parent a992bde commit 96fce2f
Showing 1 changed file with 9 additions and 22 deletions.
31 changes: 9 additions & 22 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,22 @@

These tests ensure various functionality contracts are upheld across dependency upgrades.

To get started locally, run `npx jest test/ --watchAll`.

It's suggested that you filter down tests to avoid re-running everything. The most common tests will be the webpack messages.<br>
To only run the webpack messages, type `p` followed by `webpack-message` and press `[enter]`.
To get started locally, run `npm run test:unit` or `npm run test:integration`.

## How do these work?

### `fixtures/`

Each `fixture/` gets spun up in a temporary directory and has its dependencies installed with Yarn PnP (for speed).<br> (this is todo)
To opt-out of PnP, create a `.disable-pnp` file in the specific fixture directory.
### `unit/`

#### `testSetup.scripts`
These tests are non-integration and do not involve the building of any individual packages.

##### `start`

This will run the `start` command, it can be ran asynchronously or blocking if `{ smoke: true }` is used.<br>
If ran asynchronously, it will return the `port` and a `done` function to clean up the process.
If ran blocking, it will return the `stdout` and `stderr` of the process.

##### `build`
### `fixtures/`

This will run the `build` command and return the `stdout` and `stderr` of the process.
Each `fixture/` gets spun up in a temporary directory and has its dependencies installed with npm.<br>

##### `test`
### `setup.js`

This will run the `test` command and return the `stdout` and `stderr` of the process.
This script runs before any integration tests are executed. It creates a temporary directory for each fixture, installs the local version of CRACO, any other required packages, and builds the package. You can then use an individual <test>.test.js within the fixture to start a server or check for properties of the build files.

##### `serve`
### `teardown.js`

This will run serve the application.
It will return the `port` and a `done` function to clean up the process.
This removes all temporary directories generated during integration tests.

0 comments on commit 96fce2f

Please sign in to comment.