Skip to content

test: remove useless tests#1439

Merged
spydon merged 4 commits into
mainfrom
chore/remove-useless-tests
Jun 18, 2026
Merged

test: remove useless tests#1439
spydon merged 4 commits into
mainfrom
chore/remove-useless-tests

Conversation

@spydon

@spydon spydon commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

What

Removes tests that assert nothing meaningful, duplicate other tests, or only exercise behavior that Dart itself guarantees. No production code or genuinely useful coverage is touched.

406 deletions across 5 test files.

Removed

gotrue/test/src/constants_test.dart

  • constants are consistent — re-asserts the same constants in different units (Dart Duration arithmetic).
  • v20240101 is UTC timestamp — asserts DateTime.parse('...Z').isUtc, a language guarantee.
  • The enum names match expected values test for OtpType — asserts enum.name, but OtpType serializes to the wire via .snakeCase, not .name, so it only exercised Dart's .name. (The OtpChannel and SignOutScope equivalents are kept and reworded as wire-value tests, since those enums are serialized via .name.)
  • The Enum consistency group — toString, ==, and set/map usage of enums are all Dart guarantees.
  • The Documentation and comments group — re-tests enum.name (duplicates the above).
  • The Real-world usage scenarios group — tests a local switch helper, arithmetic on hand-built lists, and fromString round-trips already covered by the kept GenerateLinkTypeExtended tests.

Kept the constant value checks (they guard wire-protocol contracts), the jsName/fromString/snakeCase mapping tests, the custom ApiVersions.name/timestamp getters, and the enum-membership (values/contains) checks.

gotrue/test/src/types/auth_exception_test.dart

  • all exception types implement Exception and all exception types extend AuthException — assert declared inheritance, fully redundant with the per-subclass extends AuthException tests.

postgrest/test/transforms_test.dart

  • The maxAffected group (5 returnsNormally smoke tests) — redundant with the maxAffected integration group right below it, which actually asserts the resulting Prefer headers.

supabase/test/client_test.dart

  • Schema Support, RPC Support, Client Options groups — only assert that statically-typed methods return their declared type (tautological isA); real coverage lives in mock_test.dart and postgrest/test/basic_test.dart.
  • Query Schema group — exact duplicate of Schema Support.
  • should properly dispose all resources — no assertions; dispose is covered with real assertions by the kept Shared YAJsonIsolate group.

supabase_flutter/test/supabase_flutter_test.dart

  • The five single-method EmptyLocalStorage tests — fully subsumed by the kept all methods work together in a typical flow test, which asserts the same contract end to end.

Test plan

  • dart analyze passes on all five files (no unused imports left behind).
  • Ran the affected suites that don't require a live backend: gotrue constants_test/auth_exception_test, supabase client_test, and supabase_flutter supabase_flutter_test all pass. postgrest/transforms_test is an integration suite needing a local PostgREST server, untouched logic.

@spydon spydon requested a review from a team as a code owner June 18, 2026 09:28
@spydon spydon merged commit ac99190 into main Jun 18, 2026
40 checks passed
@spydon spydon deleted the chore/remove-useless-tests branch June 18, 2026 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants