test(tools): add positive + negative tests for check tools (#327)#369
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
|
APIError: Insufficient Balance |
Deploying openelement with
|
| Latest commit: |
7714b11
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://dbcfd3f3.lessjs.pages.dev |
| Branch Preview URL: | https://fix-327-check-tool-tests.lessjs.pages.dev |
Refactor check-type-safety.ts and check-architecture-contract.ts for testability without changing CLI behavior: - check-type-safety.ts: extract pure scanSourcesForAnyIssues() and collectActiveSourceFiles(); export isCodeLine/Issue/SourceFile; guard main() with import.meta.main. - check-architecture-contract.ts: thread an issues array through all assertion helpers; export the helpers + classifiers (isProductionSource, isCurrentDocOrExample, isTextPath, normalizePath) + Issue/TextFile; guard main() with import.meta.main. Add tools/check-type-safety.test.ts (9 cases) and tools/check-architecture-contract.test.ts (15 cases) covering both passing and failing scenarios. Both test files are excluded from their own gates because they deliberately contain any-escape tokens.
d3db4c1 to
7714b11
Compare
Contributor
|
APIError: Insufficient Balance |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Resolves #327. Adds unit tests for the two lint-like check tools and makes them testable without changing CLI behavior.
Changes
Verification