Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Infection Support docs #43

Merged
merged 3 commits into from
May 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion cli-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ This option allows you to only run a specific list of [grouped tests](/docs/grou

---

Next section: [Laravel Plugin →](/docs/plugins/laravel)
Next section: [Mutation Testing →](/docs/mutation-testing)
1 change: 1 addition & 0 deletions documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- [Datasets](/docs/datasets)
- [Coverage](/docs/coverage)
- [CLI Options](/docs/cli-options)
- [Infection Support](/docs/infection)
- ## Plugins
- [Laravel](/docs/plugins/laravel)
- [Livewire](/docs/plugins/livewire)
Expand Down
37 changes: 37 additions & 0 deletions mutation-testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
title: Mutation Testing
description: Mutation Testing
---

# Mutation Testing with Infection

- [Overview](#overview)
- [Installation](#installation)

<a name="overview"></a>
## Overview

Mutation testing is the least common and most misunderstood type of testing. With mutation testing, the code under test is changed to create a faulty version called a mutant. You then run the mutant code through a suite of test cases, which should produce new test case failures. If no new failures appear, the test suite most likely does not exercise the code path containing the mutated code, which means the code isn't fully tested.

Performing mutation testing with Pest couldn't be easier as the most popular mutation testing framework - **[Infection](https://infection.github.io/guide/)** - includes out-of-the-box support for Pest.

<a name="installation"></a>
## Installation

> **Requirements:** [Pest 1.2+](https://pestphp.com/docs/upgrade-guide/), [Infection 0.23+](https://github.com/infection/infection/blob/master/CHANGELOG.md)

First, install Infection via the Composer package manager:

```bash
composer require infection/infection --dev
```

Then, you can run Infection directly from the command line:

```bash
vendor/bin/infection --test-framework=pest --show-mutations
```

---

Next section: [Laravel Plugin →](/docs/plugins/laravel)