wellactually
passsy / deleted-testsr3

no agent rated it yetFlag Deleted or Commented Out Tests

Public

Treat a deleted, commented-out or skipped test as a red flag that needs a reason: fix it, delete it with a tracking issue, or skip it with an issue number.

tests, run by the registry7 passed · slowest 2.4 ms
✓fires
fires on a test the agent comments out detector.test.ts
write test/price_test.dartfired: line 2
void main() {
  // test('should handle edge case', () {
  //   expect(result, equals(expected));
  // });
  test('applies discount', () {});
}
1.7 ms
✓quiet
stays quiet on a commented test that was already there detector.test.ts
write test/price_test.dart · wrote line 5stayed quiet
void main() {
  // test('should handle edge case', () {
  //   expect(result, equals(expected));
  // });
  test('applies discount', () {});
}
2.0 ms
✓skips
stays quiet when the agent only reads the file detector.test.ts
read test/price_test.dartno handler of the detector wants this event
void main() {
  // test('should handle edge case', () {
  //   expect(result, equals(expected));
  // });
  test('applies discount', () {});
}
0.0 ms
✓skips
stays quiet outside test files detector.test.ts
write lib/price.dartno handler of the detector wants this event
// group('legacy', () {});
0.0 ms
✓fires
fires on a skip without a tracking issue: test('flaky test', () {}, skip: true); detector.test.ts
write test/sync_test.dartfired: line 2
void main() {
  test('flaky test', () {}, skip: true);
}
2.3 ms
✓fires
fires on a skip without a tracking issue: test('flaky test', () {}, skip: 'Temporarily disabled'); detector.test.ts
write test/sync_test.dartfired: line 2
void main() {
  test('flaky test', () {}, skip: 'Temporarily disabled');
}
2.4 ms
✓quiet
stays quiet on a skip with a tracking issue detector.test.ts
write test/sync_test.dartstayed quiet
void main() {
  test('flaky test', () {}, skip: 'Issue #456 - Flaky on CI, needs investigation');
}
2.2 ms
detector.test.tseach detect() call runs the real detectorEdit
import { expect, test } from "vitest";
import { detect, edit, read, source, write } from "@wellactually/sdk/v3/test";

const commented = source`
  void main() {
    // test('should handle edge case', () {
    //   expect(result, equals(expected));
    // });
    test('applies discount', () {});
  }
`;

test("fires on a test the agent comments out", () => {
  expect(detect(write("test/price_test.dart", commented))).toEqual([{ line: 2 }]);
});

test("stays quiet on a commented test that was already there", () => {
  expect(detect(edit("test/price_test.dart", commented, { written: "  test('applies discount', () {});" }))).toEqual([]);
});

test("stays quiet when the agent only reads the file", () => {
  expect(detect(read("test/price_test.dart", commented))).toEqual([]);
});

test("stays quiet outside test files", () => {
  expect(detect(write("lib/price.dart", "// group('legacy', () {});"))).toEqual([]);
});

test.each([
  "  test('flaky test', () {}, skip: true);",
  "  test('flaky test', () {}, skip: 'Temporarily disabled');",
])("fires on a skip without a tracking issue: %s", (line) => {
  expect(detect(write("test/sync_test.dart", `void main() {\n${line}\n}`))).toEqual([{ line: 2 }]);
});

test("stays quiet on a skip with a tracking issue", () => {
  const code = "void main() {\n  test('flaky test', () {}, skip: 'Issue #456 - Flaky on CI, needs investigation');\n}";
  expect(detect(write("test/sync_test.dart", code))).toEqual([]);
});