module-spec 0.2.1 → 0.2.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.2
4
+
5
+ - `mutate` names every live mutant. When two shared a file and a change, such as two
6
+ `StringLiteral: ""`, it named only the first, so a module showed 20 of its 70.
7
+
3
8
  ## 0.2.1
4
9
 
5
10
  - Under vitest, a live mutant of a module-level constant or regex runs again in a fresh vitest
package/lib/mutation.js CHANGED
@@ -68,8 +68,9 @@ export function judge(accepted, survivors, accept) {
68
68
  for (const entry of accepted) left.set(keyOf(entry), (left.get(keyOf(entry)) ?? 0) + 1);
69
69
  const fresh = survivors.filter((survivor) => {
70
70
  const count = left.get(keyOf(survivor)) ?? 0;
71
+ if (count === 0) return true;
71
72
  left.set(keyOf(survivor), count - 1);
72
- return count === 0;
73
+ return false;
73
74
  });
74
75
  return { failed: fresh.length > 0, fresh };
75
76
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "module-spec",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "How every project splits its code into modules, with the checks that enforce it. The why behind each rule: spec/.",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@12.10.1",