Skip to content

Commit 970d555

Browse files
ShadowCat567Vieltojarvi
andauthored
Windows line endings in scripts tests (#2059)
* strips \r from output of api usage generator tests * added comment to explain change * altered comment * adjust comment again * another change to comment --------- Co-authored-by: Vieltojarvi <[email protected]>
1 parent a8c5e08 commit 970d555

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

scripts/components/api-changes-validator/api_usage_generator.test.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,11 @@ void describe('Api usage generator', () => {
353353
'samplePackageName',
354354
apiReportAST
355355
).generate();
356-
assert.strictEqual(apiUsage.trim(), testCase.expectedApiUsage.trim());
356+
assert.strictEqual(
357+
// .replace() removes EOL differences between Windows and other OS so output matches for all
358+
apiUsage.replace(/[\r]/g, '').trim(),
359+
testCase.expectedApiUsage.trim()
360+
);
357361
});
358362
}
359363
});

0 commit comments

Comments
 (0)