Skip to content

Latest commit

 

History

History
97 lines (62 loc) · 4.44 KB

CONTRIBUTING.md

File metadata and controls

97 lines (62 loc) · 4.44 KB

Contribute to mutation-testing-elements

This is the contribution guide for mutation-testing-elements. Great to have you here! Here are a few ways you can help make this project better.

Learn & listen

Get in touch with us through twitter or via the Stryker Slack.

Code style

Please adhere to our editorconfig, eslint rules and prettier rules.

If you're using vscode, please open the workspace.code-workspace file (note: not the directory) and install the recommended extensions.

Dependencies

Install the following:

  • An LTS version of NodeJS
  • For metrics-scala:
    • Java JDK, a recent version like 11, 17 or 21 is recommended
    • sbt, to build and test the project

Running stuff locally

We use nx to manage the packages in this repository. You don't have to install it globally. The packages themselves can be found in the packages folder.

Cheatsheet for NX

Here are some common nx commands:

  • npx nx show projects (optionall with --affected)
  • npx nx run-many --target test
  • npx nx test metrics
  • npx nx run metrics:test
  • npm run all -- --base=master

In general, whenever you want to npm run $A something, instead call npx nx $A $PROJECT where $PROJECT is the name of the project you want to run it on. For example, npm run test:unit in packages/elements becomes npx nx test:unit elements.

VSCode environment configuration

Some quick notes to help you get started:

  1. On the left side, you can see all stryker projects and plugins. Open files from there.
  2. Use CTRL+Shift+B (or ⌘+Shift+B on OSX) to run the build task. This runs npm start, compiling any changes you make in the background.
  3. Use CTRL+Shift+D (or ⌘⇧D on OSX) to open up the debug pane. Here you can select a config to run.

Have fun!

Debugging mutation-testing-elements

Unit tests

To debug the unit tests, you can place a debugger statement on the place you want to debug. Then, start the unit tests and open the dev tools to trigger the debug statement.

Integration tests

Install the VS Code Playwright plugin (from the recommended extensions). Then run any test from the sidebar in a test file.

Running Stryker on mutation-testing-elements

We support mutation testing mutation-testing-elements with Stryker! You can run it with npx nx run PACKAGE_NAME:stryker, for example npx nx run elements:stryker.

Adding new features

New features are welcome! Either as requests or proposals.

  1. Please create an issue first or let us know via the Stryker Slack
  2. Create a fork on your github account.
  3. When writing your code, please conform to the existing coding style. See .editorconfig, the typescript guidelines and our tslint.json
    • You can check if there are lint issues using npx nx run-many -t lint.
    • You can automatically fix a lot of lint issues using npm run lint:fix
  4. Please create or edit unit tests or integration tests.
  5. Run the tests using npx nx run test
  6. Push your changes and create a pull request

Don't get discouraged! We estimate that the response time from the maintainers is around 3 days or so.

Bug triage

Found a bug? Don't worry, we'll fix it, or you can ;)

Please report a bug report on our issues page. In this please:

  1. Label the issue as bug
  2. Explain what the bug is in clear English
  3. Include reproduction steps This can be an example project, code snippet, etc
  4. Include the expected behavior.
  5. Include actual behavior.
  6. Add more details if required (e.g. which browser, which test runner, which versions, etc)