Skip to content

Commit eab19e5

Browse files
committed
test: nut for alias warn
1 parent 5b0938b commit eab19e5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/commands/alias/set.nut.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,18 @@ describe('alias set NUTs', () => {
6666
expect(result).to.deep.equal([{ alias: 'foo', success: true, value: 'alias with spaces' }]);
6767
});
6868

69+
it('alias set with spaces in alias (produces warning)', () => {
70+
const value = 'bar';
71+
const result = execCmd(`alias set "foo with space"=${value} --json`, {
72+
ensureExitCode: 0,
73+
}).jsonOutput;
74+
75+
expect(result?.result).to.deep.equal([{ alias: 'foo with space', success: true, value }]);
76+
expect(result?.warnings).to.deep.equal([
77+
messages.getMessage('warning.spaceAlias', ['foo with space', 'foo with space']),
78+
]);
79+
});
80+
6981
it('allow setting a single alias without an equal sign', () => {
7082
const result = execCmd('alias set theKey theValue --json', {
7183
ensureExitCode: 0,

0 commit comments

Comments
 (0)