Skip to content

Latest commit

 

History

History
106 lines (69 loc) · 2.67 KB

File metadata and controls

106 lines (69 loc) · 2.67 KB

Rstest contributing guide

Thanks for that you are interested in contributing to Rstest. Before starting your contribution, please take a moment to read the following guidelines.

Install Node.js

Use fnm or nvm to run the command below. This will switch to the Node.js version specified in the project's .nvmrc file.

# with fnm
fnm use

# with nvm
nvm use

Install dependencies

Enable pnpm with corepack:

corepack enable

Install dependencies:

pnpm install

What this will do:

  • Install all dependencies.
  • Create symlinks between packages in the monorepo
  • Run the prepare script to set up Git hooks.

Then build all packages before running tests or e2e, as they consume the built output:

pnpm run build

Making changes and building

Once you have set up the local development environment in your forked repository, we can start development.

Checkout a new branch

It is recommended to develop on a new branch, as it will make things easier later when you submit a pull request:

git checkout -b MY_BRANCH_NAME

Build the package

Use pnpm to build a specific package:

pnpm --filter @rstest/core run build

Build all packages:

pnpm run build

You can also use the watch mode to automatically rebuild the package when you make changes:

pnpm --filter @rstest/core run build --watch

Testing

Run unit tests:

pnpm test

Run e2e tests:

pnpm e2e

Browser e2e tests

Browser-mode e2e fixtures set headless: true in their rstest.config.ts so no browser windows pop up locally. A few headed smoke tests (tests that explicitly need a visible browser, e.g. viewport assertions) are skipped locally by default and only run on CI. Run them from the e2e/ directory, for example:

cd e2e && RSTEST_E2E_RUN_HEADED=true pnpm test browser-mode/basic.test.ts

Releasing

Repository maintainers can publish new versions of changed packages.

  1. Run the local release command pnpm bump to bump all Rstest packages together.
  2. The command will prompt for a bump type. It creates a local commit only (no tag, no push).
  3. Open a pull request with a title like release: 0.7.10 and ensure CI passes.
  4. Trigger the release action to publish packages to npm.
  5. Merge the release pull request to main.
  6. Use the create-draft-release-notes skill to create a draft GitHub release note. Review the draft release note, optionally add release highlights, and publish it.