Skip to content

Add regression tests for inline schema autocompletion #796

@yamcodes

Description

@yamcodes

Context

Inline schema autocompletion (without the type() helper) has regressed twice now:

Both times the root cause was changes to the createEnv overload signatures in create-env.ts that broke TypeScript's ability to provide string literal suggestions for ArkType DSL values.

Task

Add automated regression tests that catch autocompletion breakage. Options to explore:

  • @arktype/attest or similar type-level testing to assert that EnvSchema<T> resolves correctly for inline objects
  • dtslint / tsd / expect-type style assertions that verify the parameter type narrows to ArkType's string DSL union
  • A simple type-level test that ensures arkenv({ KEY: "..." }) infers the same types as arkenv(type({ KEY: "..." })) — if the types diverge, autocompletion likely broke
  • Vitest type testing

The goal is to prevent this from silently regressing a third time.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions