simplified argument collection

Signed-off-by: Phred <fearphage@gmail.com>
This commit is contained in:
Phred 2021-08-06 08:56:33 -05:00
parent 4222161e3e
commit af4fd4efb5
No known key found for this signature in database
GPG key ID: 8103F27168DAA2A0
2 changed files with 33 additions and 21 deletions

View file

@ -636,6 +636,19 @@ describe('asyncForEach', () => {
});
});
describe('flagMap', () => {
it('should prepend array elements with the provided flag', async () => {
const testValues = ['a', 'b', 'c'];
const results: string[][] = context.flagMap(testValues, '--catpants');
expect(results).toEqual([
['--catpants', 'a'],
['--catpants', 'b'],
['--catpants', 'c'],
]);
});
});
describe('setOutput', () => {
beforeEach(() => {
process.stdout.write = jest.fn();