passsy / parity-tests-for-shared-behaviorr3
Prove Parity Between Paths That Claim to Agree
PublicWhen two public paths claim the same behavior, add tests that pin them to each other on the tricky inputs so they cannot drift apart.
tests, run by the registry4 passed · slowest 3.9 ms
- The advice links to wellactually.dev
✓fires3.0 ms
points at the principle when the user asks for a parity test in a Dart project
prompt · in fixtures/dart_appfired: "parity test"
Add a parity test for validate and isValid✓quiet2.3 ms
stays quiet on the same words outside a Dart project
promptstayed quiet
Add a parity test for validate and isValid✓quiet3.9 ms
stays quiet on parity that is not about tests
prompt · in fixtures/dart_appstayed quiet
Check feature parity with the iOS app✓quiet3.7 ms
stays quiet on a prompt about something else
prompt · in fixtures/dart_appstayed quiet
Add a test for the expired tokendetector.test.tseach detect() call runs the real detectorEdit
import { expect, test } from "vitest";
import { detect, prompt } from "@wellactually/sdk/v3/test";
const dartApp = { project: "fixtures/dart_app" };
test("points at the principle when the user asks for a parity test in a Dart project", () => {
expect(detect(prompt("Add a parity test for validate and isValid"), dartApp)).toEqual([{ match: "parity test", depth: "pointer" }]);
});
test("stays quiet on the same words outside a Dart project", () => {
expect(detect(prompt("Add a parity test for validate and isValid"))).toEqual([]);
});
test("stays quiet on parity that is not about tests", () => {
expect(detect(prompt("Check feature parity with the iOS app"), dartApp)).toEqual([]);
});
test("stays quiet on a prompt about something else", () => {
expect(detect(prompt("Add a test for the expired token"), dartApp)).toEqual([]);
});