Skip to content

Commit

Permalink
Merge pull request #626 from salesforcecli/sm/cross-os-line-endings-n…
Browse files Browse the repository at this point in the history
…ut-fix

test: ignore line ending differences across os
  • Loading branch information
WillieRuemmele authored Jun 5, 2024
2 parents 2392abd + 400f685 commit cdc66d2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/commands/alias/set.nut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ describe('alias set NUTs', () => {
}).jsonOutput;

expect(result?.result).to.deep.equal([{ alias: 'foo with space', success: true, value }]);
expect(result?.warnings).to.deep.equal([
messages.getMessage('warning.spaceAlias', ['foo with space', 'foo with space']),
]);
expect(result?.warnings?.map(stripLineEndings)).to.deep.equal(
[messages.getMessage('warning.spaceAlias', ['foo with space', 'foo with space'])].map(stripLineEndings)
);
});

it('allow setting a single alias without an equal sign', () => {
Expand Down Expand Up @@ -182,3 +182,5 @@ describe('alias set NUTs', () => {
});
});
});

const stripLineEndings = (str?: string): string => str?.replace(/\r?\n|\r/g, '') ?? '';

0 comments on commit cdc66d2

Please sign in to comment.