mirror of
https://github.com/yamadashy/repomix.git
synced 2026-05-30 11:18:53 +02:00
e51d77a7c6
Adds a size-based output splitter via --split-output (kb/mb) and writes numbered parts without splitting within a top-level folder. Also updates metrics aggregation for multi-part output and adds unit tests.
40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { buildCliConfig } from '../../../src/cli/actions/defaultAction.js';
|
|
import type { CliOptions } from '../../../src/cli/types.js';
|
|
|
|
describe('buildCliConfig', () => {
|
|
describe('tokenCountTree option', () => {
|
|
it('should handle boolean tokenCountTree', () => {
|
|
const options: CliOptions = {
|
|
tokenCountTree: true,
|
|
};
|
|
|
|
const result = buildCliConfig(options);
|
|
|
|
expect(result.output?.tokenCountTree).toBe(true);
|
|
});
|
|
|
|
it('should handle numeric tokenCountTree', () => {
|
|
const options: CliOptions = {
|
|
tokenCountTree: 100,
|
|
};
|
|
|
|
const result = buildCliConfig(options);
|
|
|
|
expect(result.output?.tokenCountTree).toBe(100);
|
|
});
|
|
});
|
|
|
|
describe('splitOutput option', () => {
|
|
it('should map splitOutput (bytes) into config', () => {
|
|
const options: CliOptions = {
|
|
splitOutput: 1024,
|
|
};
|
|
|
|
const result = buildCliConfig(options);
|
|
|
|
expect(result.output?.splitOutput).toBe(1024);
|
|
});
|
|
});
|
|
});
|