Pragmatic property-based testing review and first-wave adoption for this listings-webapp monorepo (Jest + fast-check, unit tests only).
76%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.agents/skills/pbt-pragmatic-adoption/SKILL.mdUse this skill to find and introduce high-signal property-based tests (PBT) in this repository without destabilizing CI, over-abstracting tests, or replacing clear example-based tests.
Primary goal: strengthen logic-heavy unit tests with a small number of meaningful invariants.
app/, packages/*, or cdk/.e2e-tests/.app/src/components/**: mostly UI tests; only target pure helper modules.app/src/utils/** and app/src/pages/**/utils.ts: strongest PBT zone.packages/*/src/**: mixed; use PBT for pure format/order helpers, not component rendering.cdk/test/**: infrastructure assertions; PBT usually lower value here.Prefer modules that satisfy most of these:
Strong candidates identified:
app/src/utils/arrayUtils.tsapp/src/pages/validation/slug.tsapp/src/pages/api/[eventId]/utils.ts (hasOnlyDonationTicketsAvailable, hasEarlyBirdTickets, isValidEventId)app/src/components/Body/hooks/useTrackingBeacons/transform.tsapp/src/components/MoreOrganizerEvents/utils.ts (getEventsToShow, getMoreEventsFromThisOrganizerFiltered)app/src/components/SEOTags/getBaseDeepLinkAppUrl.tsapp/src/utils/correlationId.tsPossible candidates (use care):
app/src/utils/eventAuth.ts (crypto roundtrips are valid but can be heavier).packages/good-to-know/src/sections/Highlights/formatDuration.ts (valid but low business value).Bad fit candidates:
app/src/components/**.numRuns: 100seed per test file for reproducibility.Minimal pattern:
import fc from 'fast-check';
const PROPERTY_CONFIG = { numRuns: 100, seed: 20260319 };
it('matches domain invariant', () => {
fc.assert(
fc.property(arbitraryInput, (input) => {
const result = fn(input);
expect(result).toEqual(expectedFromInvariant(input));
}),
PROPERTY_CONFIG,
);
});availableTickets, expected, eventId).--runTestsByPath for targeted execution while adopting.app, packages, cdk).good candidate, possible candidate, or bad fit.fast-check only in the package where tests are added.app/src/utils/arrayUtils.test.ts
app/src/pages/validation/slug.test.ts
1003 are accepted; non-divisible are rejected.app/src/pages/api/[eventId]/utils.test.ts
hasOnlyDonationTicketsAvailable equals:
available.length > 0 && available.every(category === 'donation').arrayUtils, slug, ticket classification utils.transformTrackingBeacons grouping/order invariants.getEventsToShow and organizer filtering subset/limit invariants.getBaseDeepLinkAppUrl, parsing helpers).saski/arnesto
752f690
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.