-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: remove dead code * style: deprecation message * chore: bump oclif/core for tests * chore: sfdx-core top-level imports * chore: bump oclif/core for fix * chore: bump lots of things --------- Co-authored-by: mshanemc <[email protected]>
- Loading branch information
1 parent
0474c89
commit cfd04e8
Showing
14 changed files
with
507 additions
and
1,190 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 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 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 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 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 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,45 @@ | ||
/* | ||
* Copyright (c) 2024, salesforce.com, inc. | ||
* All rights reserved. | ||
* Licensed under the BSD 3-Clause license. | ||
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause | ||
*/ | ||
import { expect } from 'chai'; | ||
import { Command, Interfaces } from '@oclif/core'; | ||
import { arrayWithDeprecation } from '../../src/compatibility.js'; | ||
|
||
describe('arrayWithDeprecation', () => { | ||
class TestCommand extends Command { | ||
public static flags = { | ||
things: arrayWithDeprecation({ | ||
char: 'a', | ||
description: 'api version for the org', | ||
}), | ||
}; | ||
|
||
public async run(): Promise<Interfaces.InferredFlags<typeof TestCommand.flags>> { | ||
const { flags } = await this.parse(TestCommand); | ||
return flags; | ||
} | ||
} | ||
|
||
it('should split the flags on comma', async () => { | ||
const result = await TestCommand.run(['--things', 'a,b,c']); | ||
expect(result.things).to.deep.equal(['a', 'b', 'c']); | ||
}); | ||
|
||
it('should split the flags on comma and ignore spaces', async () => { | ||
const result = await TestCommand.run(['--things', 'a, b, c']); | ||
expect(result.things).to.deep.equal(['a', 'b', 'c']); | ||
}); | ||
|
||
it('should not split on escaped commas', async () => { | ||
const result = await TestCommand.run(['--things', 'a\\,b,c']); | ||
expect(result.things).to.deep.equal(['a,b', 'c']); | ||
}); | ||
|
||
it('should allow multiple flag inputs', async () => { | ||
const result = await TestCommand.run(['--things', 'a', '--things', 'b', '--things', 'c']); | ||
expect(result.things).to.deep.equal(['a', 'b', 'c']); | ||
}); | ||
}); |
This file contains 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 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 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 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 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
Oops, something went wrong.