test: unit-test coverage Stage 1 + isomorphic helper cleanup#3147
Open
bk201- wants to merge 2 commits into
Open
test: unit-test coverage Stage 1 + isomorphic helper cleanup#3147bk201- wants to merge 2 commits into
bk201- wants to merge 2 commits into
Conversation
Contributor
🎭 E2E Tests (Playwright + VS Code)Commit: 2495001 🧪 Result
📥 Artifacts (run)
|
Contributor
🔨 Build, Lint & Test🔗 Source
📦 Package Information
🧪 Test Results
📥 Artifacts (run)✅ Build StatusBuild and local tests passed. See sibling comments below for E2E and NoSQL integration results. |
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
Establishes the first stage of unit-test coverage for the
src/folder and lands theisomorphic-helper cleanup that supports it. Tracked in
plans/UnitTestCoverage.Plan.md.Unit tests — Stage 1 (pure logic)
Added focused unit tests (Vitest) for pure, isomorphic logic:
utils/cosmosDBAccountName— name validation + sanitization, including length boundariesand truncation edge cases.
utils/getErrorMessage— message extraction across Error / message-like / primitive /circular inputs.
utils/azureUtils— Azure Resource ID parsing (+ throw on malformed input).utils/modelUtils—formatTokenCount,sortModelsAutoFirst,resolveSelectedModelId,and the
partitionModelsByCapabilitydomain predicate.cosmosdb/priorityLevel— effective priority-level resolution.cosmosdb/NoSqlQueryConnection— connection type-guard.ParsedConnectionString—accountId/accountName/fullIdcomposition.tree/TreeElementWith{ContextValue,Experience,StorageId}— type-guards (+ staticcreateContextValue).commands/.../CosmosDB{Database,Container,StoredProcedure,Trigger}NameStep—validateInputtested directly on the subclass (wizard base + heavy data-plane imports mocked), no
AzureWizardengine required.Supporting refactors
modelUtils.partitionModelsByCapabilitynow useses-toolkitpartition+orderByinstead of a hand-rolled loop/comparator (behavior locked by tests).
@microsoft/vscode-azext-utilshelpers with local isomorphicequivalents and added a
no-restricted-syntaxESLint deny-list to keep a single allowedsource:
nonNull*,createContextValue(moved toTreeElementWithContextValue),openUrl, andrandomUtils(→ Web CryptoglobalThis.crypto). Removed the now-unusedlocal
randomUtils.createCosmosDBClientalias withcreateCosmosDBManagementClientat all call sites and removed the alias.
Validation
npm run build(tsc type-check across all tsconfigs) — clean.npm run lint— oxlint + eslint, 0 errors.npm run prettier-fix— applied.npm run l10n— no string changes.No user-facing behavior changes; tests assert existing strings.