playwright-mutation-gate 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +40 -0
  3. package/index.js +6 -0
  4. package/package.json +28 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Vladyslav Dmitriiev
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # playwright-mutation-gate
2
+
3
+ > A passing test only means something if it can fail.
4
+
5
+ **Status: v0.0.1 is a name reservation.** The actual CLI is in development and ships as v0.1.0.
6
+
7
+ ## What it will do
8
+
9
+ `playwright-mutation-gate` checks that your green Playwright tests are green for a reason.
10
+ You mark the primary assertion in each test:
11
+
12
+ ```ts
13
+ test('checkout shows order confirmation', async ({ page }) => {
14
+ // ...
15
+ // @primary-assert
16
+ await expect(page.getByText('Order confirmed')).toBeVisible();
17
+ });
18
+ ```
19
+
20
+ The gate then inverts that assertion (`expect(x).toBeVisible()` → `expect(x).not.toBeVisible()`)
21
+ in a temporary copy of the spec and re-runs the test:
22
+
23
+ - test fails → the assertion is alive (**killed** mutation, good)
24
+ - test still passes → the assertion checks nothing (**survived**, a hollow test), so the
25
+ gate exits 1 and fails your CI run
26
+
27
+ Tests without a `@primary-assert` marker also fail the gate by default, so nothing slips
28
+ through unmarked.
29
+
30
+ ## Why
31
+
32
+ Stryker and friends mutate your application code to score unit tests. E2E suites have the
33
+ opposite blind spot: the assertion itself is often hollow. It passes against a broken app.
34
+ This tool mutates the assertions, not the app.
35
+
36
+ v0.1.0 coming soon.
37
+
38
+ ## License
39
+
40
+ MIT
package/index.js ADDED
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env node
2
+ console.error(
3
+ 'playwright-mutation-gate 0.0.1 is a name reservation.\n' +
4
+ 'The actual CLI ships as v0.1.0. Watch the npm page for updates.'
5
+ );
6
+ process.exit(1);
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "playwright-mutation-gate",
3
+ "version": "0.0.1",
4
+ "description": "Mutation testing for Playwright assertions: invert each test's primary assertion and fail the run if the test stays green. Name reservation; v0.1.0 in development.",
5
+ "keywords": [
6
+ "playwright",
7
+ "mutation-testing",
8
+ "e2e",
9
+ "testing",
10
+ "test-quality",
11
+ "assertions",
12
+ "hollow-tests",
13
+ "ci",
14
+ "qa"
15
+ ],
16
+ "license": "MIT",
17
+ "author": "Vladyslav Dmitriiev <vladyslav.dmitriiev@pm.me>",
18
+ "main": "index.js",
19
+ "bin": {
20
+ "playwright-mutation-gate": "index.js"
21
+ },
22
+ "files": [
23
+ "index.js"
24
+ ],
25
+ "engines": {
26
+ "node": ">=18"
27
+ }
28
+ }