test: migrate Clients & Misc tests to @oclif/test v4 (PR #7) #3457
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.
This PR is part of a series migrating test files from @oclif/test v2 to v4 following the package upgrade in the foundation PR. This is PR 7 of 11 in the incremental migration plan.
Description
Migrates 9 test files in the Clients & Misc category to be compatible with @oclif/test v4.1.15, including tests for OAuth client management, lab features, platform regions, and URL validation utilities.
Files Migrated (9 total)
test/unit/commands/clients/create.unit.test.ts(2 tests)test/unit/commands/clients/destroy.unit.test.ts(1 test)test/unit/commands/clients/index.unit.test.ts(3 tests)test/unit/commands/clients/info.unit.test.ts(3 tests)test/unit/commands/clients/rotate.unit.test.ts(3 tests)test/unit/commands/clients/update.unit.test.ts(3 tests)test/unit/commands/labs/info.unit.test.ts(3 tests)test/unit/commands/regions.unit.test.ts(4 tests)test/unit/lib/clients/clients.unit.test.ts(17 tests)Total: 39 tests migrated ✅
Migration Changes
All tests were updated to use the new @oclif/test v4 API:
Before (v2):
After (v4):
Key Pattern Changes
runCommand()function{stdout, stderr, error}from result instead ofctxparameterafterEach(() => nock.cleanAll())hookserrorobject from return value for expected errors instead of.catch()Error Handling Pattern
For tests expecting errors:
Before (v2):
After (v4):
Testing
✅ All 39 migrated tests pass locally
✅ No regressions in other test suites
✅ Build passes
Test Results:
Related