diff --git a/packages/repo-tools/src/commands/api-reports/api-reports.test.ts b/packages/repo-tools/src/commands/api-reports/api-reports.test.ts index 955720c52e..6401f64439 100644 --- a/packages/repo-tools/src/commands/api-reports/api-reports.test.ts +++ b/packages/repo-tools/src/commands/api-reports/api-reports.test.ts @@ -473,6 +473,17 @@ describe('buildApiReports', () => { outputDir: mockDir.resolve('node_modules/.cache/api-extractor'), }); }); + + it('should throw an error if omitMessages ends with a comma', async () => { + const opts = { + omitMessages: 'ae-missing-release-tag,', + }; + const paths = ['packages/*']; + + await expect(buildApiReports(paths, opts)).rejects.toThrow( + `Invalid value for --omit-messages: ${opts.omitMessages}\nMust be a comma-separated list of strings without spaces or wrapped in quotations.`, + ); + }); }); describe('isCI', () => { it('should set localBuild to false if CI option is passed', async () => {