Skip to content

Commit aa473b0

Browse files
committed
Test: add --force-include option and whitespace trimming for forceInclude
1 parent 71b7a63 commit aa473b0

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/cli/actions/defaultAction.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,15 +531,33 @@ describe('defaultAction', () => {
531531
});
532532
});
533533

534+
it('should handle custom force include patterns', async () => {
535+
const options: CliOptions = {
536+
forceInclude: 'coverage/*.json,test-results/*.xml',
537+
};
538+
539+
await runDefaultAction(['.'], process.cwd(), options);
540+
541+
expect(configLoader.mergeConfigs).toHaveBeenCalledWith(
542+
process.cwd(),
543+
expect.anything(),
544+
expect.objectContaining({
545+
forceInclude: ['coverage/*.json', 'test-results/*.xml'],
546+
}),
547+
);
548+
});
549+
534550
it('should properly trim whitespace from comma-separated patterns', () => {
535551
const options = {
536552
include: 'src/**/*, tests/**/*, examples/**/*',
537553
ignore: 'node_modules/**, dist/**, coverage/**',
554+
forceInclude: 'coverage/*.json, test-results/*.xml',
538555
};
539556
const config = buildCliConfig(options);
540557

541558
expect(config.include).toEqual(['src/**/*', 'tests/**/*', 'examples/**/*']);
542559
expect(config.ignore?.customPatterns).toEqual(['node_modules/**', 'dist/**', 'coverage/**']);
560+
expect(config.forceInclude).toEqual(['coverage/*.json', 'test-results/*.xml']);
543561
});
544562

545563
describe('files flag', () => {

0 commit comments

Comments
 (0)