-
Notifications
You must be signed in to change notification settings - Fork 235
test: convert Config and Features/Labs to oclif/test 4 #3449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
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
k80bowman
approved these changes
Jan 9, 2026
Contributor
k80bowman
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a question, but it's not blocking. It looks like maybe you rewrote the test and left these commented out by accident? Otherwise, this looks good!
Migrates config/edit.unit.test.ts from @oclif/test v2 to v4, completing the last test file in the Configuration tests migration. Key changes: - Add EditorFactory class with instance method to enable testability - Update config/edit command to use EditorFactory pattern - Migrate tests to use custom runCommand helper with sinon stubs - All 4 tests passing (stringToConfig, deleting vars, blanks, specific var) Uses custom runCommand helper (not @oclif/test's runCommand) because @oclif/core's dynamic module loading is incompatible with ES module mocking via sinon or esmock.
df8a775 to
47cf387
Compare
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.
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 3 of 11 in the incremental migration plan.
Descripion
Migrates 12 test files in the Configuration and Features/Labs category to be compatible with @oclif/test v4.1.15, including tests for config variable management, feature flags, and labs features. This PR introduces a special case pattern for commands with external dependencies that require the custom runCommand helper.
Files Migrated (12 total)
test/unit/commands/config/get.unit.test.ts(1 test)test/unit/commands/config/index.unit.test.ts(6 tests)test/unit/commands/config/set.unit.test.ts(4 tests)test/unit/commands/config/unset.unit.test.ts(1 test)test/unit/commands/config/edit.unit.test.ts(4 tests) *test/unit/commands/features/disable.unit.test.ts(2 tests)test/unit/commands/features/enable.unit.test.ts(2 tests)test/unit/commands/features/index.unit.test.ts(3 tests)test/unit/commands/features/info.unit.test.ts(2 tests)test/unit/commands/labs/disable.unit.test.ts(2 tests)test/unit/commands/labs/enable.unit.test.ts(2 tests)test/unit/commands/labs/index.unit.test.ts(3 tests)Total: 32 tests migrated ✅
* Special case: Uses custom runCommand helper (see notes below)
Migration Changes
Most tests were updated to use the new @oclif/test v4 API:
Before (v2):