Skip to content

Add tests for config-normalize helpers, expose internals for testability and documents bugs#118

Open
coding-creed-technologies wants to merge 1 commit intosteipete:mainfrom
coding-creed-technologies:3tg-generated-tests
Open

Add tests for config-normalize helpers, expose internals for testability and documents bugs#118
coding-creed-technologies wants to merge 1 commit intosteipete:mainfrom
coding-creed-technologies:3tg-generated-tests

Conversation

@coding-creed-technologies

Summary

This PR adds unit tests for configuration normalization helpers and introduces a small refactor to make several internal functions easier to test.

In config-normalize.ts, multiple helper functions were exported so their behavior can be tested directly.

While adding tests, three issues in the normalization logic were identified and documented in config-normalize.3tg.md. Two tests that reproduce these issues are currently skipped until the bugs are addressed.

Changes

  • Add unit tests for configuration normalization helpers
  • Export internal helper functions in config-normalize.ts to enable direct testing
  • Add tests for command parsing, header normalization, path handling, and logging normalization
  • Add tests for config-imports.ts
  • Document discovered issues in config-normalize.3tg.md
  • Add two skipped tests that reproduce known bugs

Test Isolation

To keep the tests deterministic and independent of the runtime environment:

  • Environment-dependent helpers such as expandHome are mocked where necessary
  • Command parsing and normalization logic are tested directly through the exported helpers

This allows the normalization logic to be validated independently of external configuration sources.

Notes

The new exports were introduced only to improve testability and do not change runtime behavior.

The skipped tests document currently observed bugs and can be enabled once the underlying issues are fixed.

Impact

Improves test coverage for configuration normalization and helps surface edge cases in command parsing and header handling.

The documented issues also make it easier to address potential bugs in future changes.


Attribution

This contribution was generated with assistance from 3TG.

3TG is a behavior-first test generation tool for TypeScript functions that creates clean, maintainable tests and improves developer productivity.

Add unit tests for configuration normalization helpers.

Internal functions in `config-normalize.ts` were exported to allow
direct testing of their behavior (command parsing, header handling,
path normalization, and logging normalization).

Three issues discovered during test generation are documented in
`config-normalize.3tg.md`. Two tests reproducing these issues are
currently skipped until the bugs are addressed.

Also adds tests for `config-imports.ts`.

Exports were added only to improve testability; no runtime behavior
changes were intended.
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