Skip to content

Latest commit

 

History

History
65 lines (38 loc) · 3.73 KB

CONTRIBUTING.md

File metadata and controls

65 lines (38 loc) · 3.73 KB

Contributing

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.

Getting started

Prerequisites

The following must be installed:

Fork the repo

Fork the repo into your personal account or public github organization following GitHub's official guidelines.

Install dependencies

yarn install

Guidelines

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.

Testing

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:

  1. 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.
  2. Integration tests:

Documentation

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.

Types

This is a TypeScript-first repo. Please strongly type everything; any will not be approved unless there is no other option.

Commits

This repo uses Conventional Commits, please use this when committing.

Pull requests

To get your changes merged, you'll need to follow these steps:

  1. Once you have committed your change, push it to a remote branch within your forked playwright-msw repository.
  2. Next, create a pull request from your forked version of playwright-msw. Please select valendres/playwright-msw as the base repository, and main as the base. When prompted, please fill out as much information within the Pull Request template as applicable.
  3. 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.

Commands

The following commands can be executed from the root of the repo:

  • yarn build: builds the playwright-msw library and example-* apps
  • yarn deploy: builds and deploys playwright-msw using Monodeploy
  • yarn format: runs Prettier on all files within the repo
  • yarn lint: runs ESLint on all files within the repo
  • yarn test: runs playwright-msw unit tests (Jest) and the integration tests (Playwright) for each of the example-* apps