-
Notifications
You must be signed in to change notification settings - Fork 235
test: migrate Auth & Sessions tests to @oclif/test v4 #3446
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
Open
eablack
wants to merge
12
commits into
eb/upgrade-oclif-test
Choose a base branch
from
eb/upgrade-oclif-test-auth
base: eb/upgrade-oclif-test
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
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
335bd19 to
adc81ea
Compare
- Convert from v2 chaining API to v4 runCommand API - Use async/await pattern - Import expect from chai directly - All 3 tests passing
- Convert from v2 chaining API to v4 runCommand API - Handle error exit code with error?.oclif?.exit - All 2 tests passing
- Convert from v2 chaining API to v4 runCommand API - All 3 tests passing
- Convert from v2 chaining API to v4 runCommand API - All 3 tests passing
- Convert from v2 chaining API to v4 runCommand API - All 3 tests passing
- Convert from v2 chaining API to v4 runCommand API - All 2 tests passing
- Convert from v2 chaining API to v4 runCommand API - All 1 tests passing
- Convert from v2 chaining API to v4 runCommand API - All 1 tests passing
- Convert from v2 chaining API to v4 runCommand API - All 1 tests passing
- Convert from v2 chaining API to v4 runCommand API - All 3 tests passing
- Convert from v2 chaining API to v4 captureOutput API - All 3 tests passing
9fc744c to
8c22192
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 1 of 11 in the incremental migration plan.
Summary
Migrates 11 test files in the Auth & Sessions category to be compatible with @oclif/test v4.1.15, including tests for authentication,
OAuth authorizations, and session management. This PR establishes the migration patterns used across all subsequent PRs.
Files Migrated (11 total)
Total: 25 tests migrated ✅
Migration Changes
All tests were updated to use the new @oclif/test v4 API:
Before (v2):
test
.stdout()
.nock('https://api.heroku.com', api => {
api.get('/oauth/authorizations/f6e8d969-129f-42d2-854b-c2eca9d5a42e')
.reply(200, authorization)
})
.command(['authorizations:info', 'f6e8d969-129f-42d2-854b-c2eca9d5a42e'])
.it('shows authorization info', ctx => {
expect(ctx.stdout).to.contain('[email protected]')
})
After (v4):
it('shows authorization info', async () => {
nock('https://api.heroku.com')
.get('/oauth/authorizations/f6e8d969-129f-42d2-854b-c2eca9d5a42e')
.reply(200, authorization)
})
Key Pattern Changes
Testing
Notes
This PR establishes the migration patterns and approach that will be used across all subsequent PRs in the migration plan. The patterns
have been validated to work with core authentication functionality.
Related