PR's are welcome. The fastest way to get a change in is to make a PR. If you're not sure how to fix something, feel free to create a New Issue. If you just have a question, please start a New Discussion.
The following must be installed:
- Node.js:
>=14
- Yarn berry
Fork the repo into your personal account or public github organization following GitHub's official guidelines.
yarn install
Given that this tool is likely utilized in CI pipelines for ensuring that a website or app is behaving as expected, is is critical that we minimise breaking changes as much as possible. Where it makes sense to do so, automation tests (Unit & Integration) and documentation should be updated.
For a PR to be merged, tests must be written to ensure that your contribution behaves the way you expect it to behave. Your PR will not be merged until this is done and all tests are passing.
There are two kinds of tests within this repo:
- Unit tests: These tests are written using Jest are defined within the playwright-msw package. If it makes sense to do so (e.g. logic is updated), unit tests should be included. Changes to existing tests should be avoided if possible as this could potentially constitute a breaking change.
- Integration tests:
If you're modifying any of the consumer-facing code to the library (exposed functions, config options etc.), the playwright-msw/README.md must be updated to reflect these changes. Your PR will not be merged until this is done.
This is a TypeScript-first repo. Please strongly type everything; any
will not be approved unless there is no other option.
This repo uses Conventional Commits, please use this when committing.
To get your changes merged, you'll need to follow these steps:
- Once you have committed your change, push it to a remote branch within your forked
playwright-msw
repository. - Next, create a pull request from your forked version of
playwright-msw
. Please selectvalendres/playwright-msw
as the base repository, andmain
as the base. When prompted, please fill out as much information within the Pull Request template as applicable. - Finally, please be patient as we review your pull request. We may ask for a few things to be changed, but we only do this to ensure the quality of the codebase going forward. We endeavour to get all contributions merged ASAP.
The following commands can be executed from the root of the repo:
yarn build
: builds theplaywright-msw
library andexample-*
appsyarn deploy
: builds and deploysplaywright-msw
using Monodeployyarn format
: runs Prettier on all files within the repoyarn lint
: runs ESLint on all files within the repoyarn test
: runsplaywright-msw
unit tests (Jest) and the integration tests (Playwright) for each of theexample-*
apps