Skip to content

Add type system tests for SettingsDefinition#747

Merged
dskloetc merged 1 commit intomainfrom
kloet/config-type-test
Apr 24, 2026
Merged

Add type system tests for SettingsDefinition#747
dskloetc merged 1 commit intomainfrom
kloet/config-type-test

Conversation

@dskloetc
Copy link
Copy Markdown
Contributor

Description

The config system defines some intricate types that enforce certain characteristics on the settings derived from the definition. Things like "if a setting of type 'number' has a default value, that default value must be a number or "only settings of type 'enum' can have options.

I'm looking into extending the config system to support variable variables where the actual variable name depends on a parameter such as network.

In the process, I'll be changing the types and I want to make sure I don't break the existing restriction imposed by the type system.

Change

Add a file with "type system tests". These are type declarations that either must be accepted or rejected by the compiler. The ones that must be rejected are annotated with @ts-expect-error. This will cause the compiler to produce an error if the type declaration ever becomes valid.

Testing

  1. Run yarn test.
  2. I've manually changed some of the test to check that they fail in the expected way.

@dskloetc dskloetc added the none label Apr 24, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

NPM Publishing labels 🏷️

🔵 This PR has the none label set and it will not cause a version bump.

@dskloetc dskloetc marked this pull request as ready for review April 24, 2026 14:17
@dskloetc dskloetc requested a review from a team as a code owner April 24, 2026 14:17
@dskloetc dskloetc force-pushed the kloet/config-type-test branch from dae64a6 to 396f593 Compare April 24, 2026 14:31
@dskloetc dskloetc merged commit 20d894c into main Apr 24, 2026
15 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

❌ failed to create version bump PR
Failure message: No message provided
Failed job: createVersionBumpPR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants