Add unit test for checking invalid comma parsing

Signed-off-by: Juan Escalada <juanescalada175@gmail.com>
This commit is contained in:
Juan Escalada
2024-11-21 11:56:05 +09:00
parent 16689f4d50
commit 5e25365997
@@ -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 () => {