chore(tests): consolidate unit tests subsumed by property tests#422
Conversation
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨Init
Issue List
Other
Bug Fixes 🐛Dsn
Init
Other
Documentation 📚
Internal Changes 🔧Init
Tests
Other
Other
🤖 This preview updates automatically when you update the PR. |
Codecov Results 📊✅ 111 passed | Total: 111 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 100.00%. Project has 1065 uncovered lines. Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 95.03% 95.03% —%
==========================================
Files 159 159 —
Lines 21431 21431 —
Branches 0 0 —
==========================================
+ Hits 20366 20366 —
- Misses 1065 1065 —
- Partials 0 0 —Generated by Codecov Action |
5d1bb95 to
ec96ff3
Compare
ec96ff3 to
e86305a
Compare
|
Addressed both BugBot findings — good catches:
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Remove ~620 lines of unit tests that duplicate invariants already covered by companion property-based tests. Each unit test file now has a header comment documenting which invariants are in the property file and what remains in the unit file. Files trimmed: - test/lib/dsn.test.ts: Remove extractOrgIdFromHost, parseDsn (basic), isValidDsn, createDsnFingerprint (ordering/dedup), createDetectedDsn (basic) — all covered by dsn.property.test.ts. Keep: self-hosted DSN fingerprints, trailing slash edge case, path segments, packagePath. - test/lib/promises.test.ts: Remove basic true/false/error tests — covered by promises.property.test.ts. Keep: concurrency timing tests, single-resolution guarantee. - test/lib/bspatch.test.ts: Remove offtin unit tests and parsePatchHeader rejection tests — covered by bspatch.property.test.ts. Keep: fixture- based patch application, SHA-256 verification, truncated patch. - test/lib/db/auth.test.ts: Remove priority, source tracking, refresh skip, isEnvTokenActive basics — covered by auth.property.test.ts. Keep: whitespace edge cases, isAuthenticated, getActiveEnvVarName, shape assertions. - test/lib/formatters/json.test.ts: Remove filterFields basics and parseFieldsList dedup/whitespace — covered by json.property.test.ts. Keep: dot-notation edge cases, null/undefined in objects, writeJson, writeJsonList, formatJson APIs. - test/lib/formatters/trace.test.ts: Remove redundant newline/contains checks — covered by trace.property.test.ts. Keep: specific format values, rendered vs plain mode, computeTraceSummary edge cases.
e86305a to
d6c7c74
Compare
|
Addressed both round-2 BugBot findings:
|

Remove ~620 lines of unit tests across 6 files where the same invariants
are already covered by companion property-based tests. This is a follow-up to
#418 which removed standalone low-value tests.
What changed
Each unit test file was audited against its
.property.test.tscounterpart.Tests that verify the same invariant the property tests generate random inputs
for were removed. Tests that remain fall into categories the property tests
don't cover:
slashes, whitespace/empty strings, null intermediates in dot-paths)
rendered vs plain mode)
Files trimmed
test/lib/dsn.test.tstest/lib/formatters/json.test.tstest/lib/db/auth.test.tstest/lib/bspatch.test.tstest/lib/promises.test.tstest/lib/formatters/trace.test.ts