[Test Improver] Add unit tests for aws.ts and kube.js utilities#17699
Merged
Conversation
- aws.test.ts: 17 tests covering isIpv4Network, isIpv6Network, getVpcDisplayName, and getSubnetDisplayName with edge cases (absent tags, empty arrays, multiple tags, no Name key). - kube.test.ts: 12 tests covering normalizeName with whitespace, case, hyphens, null/undefined, and mixed inputs. - Combined coverage: 100% stmts/branches/fns/lines. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
12 tasks
nwmac
approved these changes
May 18, 2026
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.
🤖 Test Improver — automated AI assistant
Goal and Rationale
Add unit tests for two pure utility files with no test coverage:
shell/utils/aws.ts— exports four pure functions used across AWS provisioning flows:isIpv4Network,isIpv6Network,getVpcDisplayName,getSubnetDisplayName.shell/utils/kube.js— exportsnormalizeName, a string normalization function that produces valid Kubernetes resource names.Both are pure functions with clear semantics, real branching logic, and multiple edge cases worth verifying.
Approach
aws.test.ts: 17 tests covering all four exported functions — tag presence/absence, empty arrays, multiple tags, undefined fields, and theIpv6CidrBlockAssociationSetarray length check.kube.test.ts: 12 tests coveringnormalizeName— whitespace trimming, case-folding, space-to-hyphen replacement, consecutive hyphen collapse, leading/trailing hyphen removal, and null/undefined inputs.it.eachwith named object entries per project style.Coverage Impact
aws.ts— Stmts/Branches/Fns/Lineskube.js— Stmts/Branches/Fns/LinesTrade-offs
Reproducibility
Test Status
✅ All 29 new tests pass. No existing tests broken. Lint clean.
Fixes #
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
download.cypress.ioSee Network Configuration for more information.