-
Notifications
You must be signed in to change notification settings - Fork 11
Andrewpai/yes flag #55
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
andrewpai
wants to merge
17
commits into
next
Choose a base branch
from
andrewpai/yes-flag
base: next
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.
Open
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
8fd2176
adding workflow test on pull-request
mark-robustelli 56d6920
updating with only main branch for test
mark-robustelli b59c9ee
Trying out --yes on kickstart:kill
andrewpai 96baa6f
removed promotional logging for dotenvx
andrewpai 771819c
camel-> kebab case, tests
andrewpai ede789d
package-lock version update
andrewpai 7970a98
Address PR review feedback
andrewpai 32a1c5e
Add test coverage for confirmOrExit and kickstart:kill
andrewpai ec3866e
Fix confirmOrExit silently proceeding when process.exit is mocked/def…
andrewpai edf29b6
Add test coverage for import:generate deprecated-flag detection
andrewpai 3b36c2a
Fix crypto.randomUUID global usage and confirmOrExit non-interactive gap
andrewpai 1bd9953
fix(ci): remove stale duplicate pull_request trigger from test workflow
andrewpai b65851b
fix(test): pin integration test FusionAuth image to 1.69.2
andrewpai 7ef4168
test: cleaned up tests and brought in validator lib for email validation
andrewpai be6e13c
chore: remove CONTRIBUTING.md
andrewpai a0bd2b9
fix: exit with non-zero status on kickstart:install failure, fix typo
andrewpai 43d08ca
test: replaced mock-fs with real temp dir-based file testing
andrewpai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| import { describe, test } from "node:test" | ||
| import assert from "node:assert/strict" | ||
| import { getDeprecatedFlagUsage, importGenerate } from "../../src/commands/import-generate.js" | ||
|
|
||
| describe('getDeprecatedFlagUsage()', () => { | ||
| test('returns empty array when no deprecated flags are used', () => { | ||
| const usage = getDeprecatedFlagUsage(['node', 'script', '--number-of-files', '5']) | ||
| assert.deepEqual(usage, []) | ||
| }) | ||
|
|
||
| test('detects a bare deprecated flag (--flag value form)', () => { | ||
| const usage = getDeprecatedFlagUsage(['node', 'script', '--numberOfFiles', '5']) | ||
| assert.equal(usage.length, 1) | ||
| assert.deepEqual(usage[0], ['--numberOfFiles', '--number-of-files']) | ||
| }) | ||
|
|
||
| test('detects a deprecated flag in --flag=value form', () => { | ||
| const usage = getDeprecatedFlagUsage(['node', 'script', '--numberOfFiles=5']) | ||
| assert.equal(usage.length, 1) | ||
| assert.deepEqual(usage[0], ['--numberOfFiles', '--number-of-files']) | ||
| }) | ||
|
|
||
| test('detects multiple deprecated flags used together', () => { | ||
| const usage = getDeprecatedFlagUsage(['node', 'script', '--numberOfFiles', '5', '--groupId=abc']) | ||
| const oldFlags = usage.map(([old]) => old) | ||
| assert.ok(oldFlags.includes('--numberOfFiles')) | ||
| assert.ok(oldFlags.includes('--groupId')) | ||
| assert.equal(usage.length, 2) | ||
| }) | ||
|
|
||
| test('does not flag the new kebab-case form as deprecated', () => { | ||
| const usage = getDeprecatedFlagUsage(['node', 'script', '--group-id', 'abc']) | ||
| assert.deepEqual(usage, []) | ||
| }) | ||
| }) | ||
|
|
||
| describe('import:generate option parsing', () => { | ||
| test('deprecated --numberOfFiles populates the same option as --number-of-files', async () => { | ||
| let capturedOptions | ||
| importGenerate.action((options) => { capturedOptions = options }) | ||
|
|
||
| await importGenerate.parseAsync(['--numberOfFiles', '5'], { from: 'user' }) | ||
|
|
||
| assert.equal(capturedOptions.numberOfFiles, '5') | ||
| }) | ||
|
|
||
| test('--number-of-files populates the same numberOfFiles property', async () => { | ||
| let capturedOptions | ||
| importGenerate.action((options) => { capturedOptions = options }) | ||
|
|
||
| await importGenerate.parseAsync(['--number-of-files', '7'], { from: 'user' }) | ||
|
|
||
| assert.equal(capturedOptions.numberOfFiles, '7') | ||
| }) | ||
|
|
||
| test('deprecated --groupId populates the same option as --group-id', async () => { | ||
| let capturedOptions | ||
| importGenerate.action((options) => { capturedOptions = options }) | ||
|
|
||
| await importGenerate.parseAsync(['--groupId', 'abc-123'], { from: 'user' }) | ||
|
|
||
| assert.equal(capturedOptions.groupId, 'abc-123') | ||
| }) | ||
| }) | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.