test: comprehensive test coverage improvements (pure functions, SDK validation, command tests)#156
Draft
NianJiuZst wants to merge 17 commits into
Draft
test: comprehensive test coverage improvements (pure functions, SDK validation, command tests)#156NianJiuZst wants to merge 17 commits into
NianJiuZst wants to merge 17 commits into
Conversation
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.
Summary
Adds comprehensive test coverage across four categories: pure utilities, SDK validation logic, thin command tests, and polling logic.
277 → 285 tests (+70 new, some existing tests enhanced)
Changes by category
Pure function unit tests (5 commits)
maskTokenutils/token.tsCLIError/SDKErrorerrors/base.tstoJSON(), hintisInteractive/isCIutils/env.tsparseConfigFileconfig/schema.tsSDK validateParams tests (5 commits)
All SDK validation rules now tested — previously 0% coverage:
SpeechSDKImageSDKVideoSDKMusicSDKTextSDKCommand test improvements (4 commits)
image generatefile uploadsearch queryquota showPolling logic (1 commit)
polling/poll.tsTest results
Design notes
quota showmock server test was not possible becausequotaEndpoint()rewrites the hostname toapi.*subdomain, which breaks localhost mock server routingorigin/mainbefore any of these changesFiles changed
test/utils/token.test.tstest/errors/base.test.tstest/utils/env.test.tstest/config/schema.test.tstest/polling/poll.test.tstest/sdk/text.test.tstest/sdk/image.test.tstest/sdk/video.test.tstest/sdk/music.test.tstest/sdk/speech.test.tstest/commands/image/generate.test.tstest/commands/file/upload.test.tstest/commands/search/query.test.tstest/commands/quota/show.test.ts