Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions lib/command-parser/expand-arguments.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ it('argument placeholder is replaced and quoted properly', () => {
expect(parser.parse(commandInfo)).toEqual({ ...commandInfo, command: "echo 'foo bar'" });
});

it('argument placeholder with single quote and exclamation mark is quoted properly', () => {
const parser = new ExpandArguments(["it's great!"]);
const commandInfo = createCommandInfo('echo {1}');
expect(parser.parse(commandInfo)).toEqual({
...commandInfo,
command: `echo 'it'"'"'s great!'`,
});
});

it('multiple single argument placeholders are replaced', () => {
const parser = new ExpandArguments(['foo', 'bar']);
const commandInfo = createCommandInfo('echo {2} {1}');
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"dependencies": {
"chalk": "5.6.2",
"rxjs": "7.8.2",
"shell-quote": "1.9.0",
"shell-quote": "1.12.0",
"supports-color": "10.2.2",
"tree-kill": "1.2.2",
"yargs": "18.0.0"
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading