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 96fce2f commit 46d7327
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,15 @@ This script runs before any integration tests are executed. It creates a tempora
### `teardown.js`

This removes all temporary directories generated during integration tests.

## How can I make my own tests?

### Unit tests

To create your own unit test, you can simply setup a directory within `unit/`, import necessary craco files, and test specific features.

### Integration tests

To create your own integration test, create a new directory under `integration/fixtures/`. You can then create a directory within called `test-package-files`, which should contain all necessary files for your package (public/index.html, craco.config.js, src/index.js, etc). These will be copied over to the temporary directory on test execution.

You can then create a index.test.js in `integration/fixtures/<testname>` to interface with the built package. It's recommended run a local server, then use playwright to test individual features of the live website. View `integration/fixtures/basic-integration-test` for an example.

0 comments on commit 46d7327

Please sign in to comment.