aitelier 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/add.d.ts +3 -0
- package/dist/commands/add.d.ts.map +1 -0
- package/dist/commands/add.js +141 -0
- package/dist/commands/add.js.map +1 -0
- package/dist/commands/add.test.d.ts +2 -0
- package/dist/commands/add.test.d.ts.map +1 -0
- package/dist/commands/add.test.js +203 -0
- package/dist/commands/add.test.js.map +1 -0
- package/dist/commands/eval.d.ts +3 -0
- package/dist/commands/eval.d.ts.map +1 -0
- package/dist/commands/eval.js +505 -0
- package/dist/commands/eval.js.map +1 -0
- package/dist/commands/eval.test.d.ts +2 -0
- package/dist/commands/eval.test.d.ts.map +1 -0
- package/dist/commands/eval.test.js +804 -0
- package/dist/commands/eval.test.js.map +1 -0
- package/dist/commands/format.d.ts +3 -0
- package/dist/commands/format.d.ts.map +1 -0
- package/dist/commands/format.js +198 -0
- package/dist/commands/format.js.map +1 -0
- package/dist/commands/format.test.d.ts +2 -0
- package/dist/commands/format.test.d.ts.map +1 -0
- package/dist/commands/format.test.js +568 -0
- package/dist/commands/format.test.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +94 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/init.test.d.ts +2 -0
- package/dist/commands/init.test.d.ts.map +1 -0
- package/dist/commands/init.test.js +123 -0
- package/dist/commands/init.test.js.map +1 -0
- package/dist/commands/rate.d.ts +3 -0
- package/dist/commands/rate.d.ts.map +1 -0
- package/dist/commands/rate.js +209 -0
- package/dist/commands/rate.js.map +1 -0
- package/dist/commands/rate.test.d.ts +2 -0
- package/dist/commands/rate.test.d.ts.map +1 -0
- package/dist/commands/rate.test.js +393 -0
- package/dist/commands/rate.test.js.map +1 -0
- package/dist/commands/split.d.ts +3 -0
- package/dist/commands/split.d.ts.map +1 -0
- package/dist/commands/split.js +210 -0
- package/dist/commands/split.js.map +1 -0
- package/dist/commands/split.test.d.ts +2 -0
- package/dist/commands/split.test.d.ts.map +1 -0
- package/dist/commands/split.test.js +503 -0
- package/dist/commands/split.test.js.map +1 -0
- package/dist/commands/stats.d.ts +3 -0
- package/dist/commands/stats.d.ts.map +1 -0
- package/dist/commands/stats.js +209 -0
- package/dist/commands/stats.js.map +1 -0
- package/dist/commands/stats.test.d.ts +2 -0
- package/dist/commands/stats.test.d.ts.map +1 -0
- package/dist/commands/stats.test.js +476 -0
- package/dist/commands/stats.test.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +132 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/status.test.d.ts +2 -0
- package/dist/commands/status.test.d.ts.map +1 -0
- package/dist/commands/status.test.js +443 -0
- package/dist/commands/status.test.js.map +1 -0
- package/dist/commands/train.d.ts +3 -0
- package/dist/commands/train.d.ts.map +1 -0
- package/dist/commands/train.js +139 -0
- package/dist/commands/train.js.map +1 -0
- package/dist/commands/train.test.d.ts +2 -0
- package/dist/commands/train.test.d.ts.map +1 -0
- package/dist/commands/train.test.js +288 -0
- package/dist/commands/train.test.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/openai.d.ts +9 -0
- package/dist/providers/openai.d.ts.map +1 -0
- package/dist/providers/openai.js +20 -0
- package/dist/providers/openai.js.map +1 -0
- package/dist/providers/together.d.ts +11 -0
- package/dist/providers/together.d.ts.map +1 -0
- package/dist/providers/together.js +118 -0
- package/dist/providers/together.js.map +1 -0
- package/dist/providers/types.d.ts +28 -0
- package/dist/providers/types.d.ts.map +1 -0
- package/dist/providers/types.js +2 -0
- package/dist/providers/types.js.map +1 -0
- package/dist/storage/config.d.ts +24 -0
- package/dist/storage/config.d.ts.map +1 -0
- package/dist/storage/config.js +11 -0
- package/dist/storage/config.js.map +1 -0
- package/dist/storage/dataset.d.ts +14 -0
- package/dist/storage/dataset.d.ts.map +1 -0
- package/dist/storage/dataset.js +18 -0
- package/dist/storage/dataset.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.d.ts","sourceRoot":"","sources":["../../src/commands/add.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAYzC,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAclD"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import inquirer from 'inquirer';
|
|
2
|
+
import { readFile, access } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { appendExample, readExamples } from '../storage/dataset.js';
|
|
5
|
+
import { loadConfig } from '../storage/config.js';
|
|
6
|
+
const CONFIG_FILE = '.ftpipeline.json';
|
|
7
|
+
const EXAMPLES_FILE = 'data/examples.jsonl';
|
|
8
|
+
export function registerAdd(program) {
|
|
9
|
+
program
|
|
10
|
+
.command('add')
|
|
11
|
+
.description('Add a training example (input/output pair)')
|
|
12
|
+
.option('-i, --input <path>', 'Path to file containing input text')
|
|
13
|
+
.option('-o, --output <path>', 'Path to file containing output text')
|
|
14
|
+
.action(async (options) => {
|
|
15
|
+
try {
|
|
16
|
+
await addCommand(options);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
console.error(`Error: ${error instanceof Error ? error.message : String(error)}`);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
async function addCommand(options) {
|
|
25
|
+
const cwd = process.cwd();
|
|
26
|
+
// Check if project is initialized
|
|
27
|
+
try {
|
|
28
|
+
await access(join(cwd, CONFIG_FILE));
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
throw new Error('Project not initialized. Run `ft init` first to create .ftpipeline.json');
|
|
32
|
+
}
|
|
33
|
+
// Load project config for system prompt
|
|
34
|
+
const config = await loadConfig(cwd);
|
|
35
|
+
// Determine mode and collect input/output
|
|
36
|
+
let inputContent;
|
|
37
|
+
let outputContent;
|
|
38
|
+
if (options.input && options.output) {
|
|
39
|
+
// File mode
|
|
40
|
+
inputContent = await readFile(options.input, 'utf-8');
|
|
41
|
+
outputContent = await readFile(options.output, 'utf-8');
|
|
42
|
+
}
|
|
43
|
+
else if (options.input || options.output) {
|
|
44
|
+
// Partial flags - error
|
|
45
|
+
throw new Error('Both --input and --output must be provided together');
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
// Interactive mode
|
|
49
|
+
const answers = await inquirer.prompt([
|
|
50
|
+
{
|
|
51
|
+
type: 'editor',
|
|
52
|
+
name: 'input',
|
|
53
|
+
message: 'Enter the input (user message):',
|
|
54
|
+
validate: (input) => {
|
|
55
|
+
if (!input.trim()) {
|
|
56
|
+
return 'Input cannot be empty';
|
|
57
|
+
}
|
|
58
|
+
return true;
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
type: 'editor',
|
|
63
|
+
name: 'output',
|
|
64
|
+
message: 'Enter the output (assistant response):',
|
|
65
|
+
validate: (output) => {
|
|
66
|
+
if (!output.trim()) {
|
|
67
|
+
return 'Output cannot be empty';
|
|
68
|
+
}
|
|
69
|
+
return true;
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
]);
|
|
73
|
+
inputContent = answers.input;
|
|
74
|
+
outputContent = answers.output;
|
|
75
|
+
}
|
|
76
|
+
// Trim and validate
|
|
77
|
+
inputContent = inputContent.trim();
|
|
78
|
+
outputContent = outputContent.trim();
|
|
79
|
+
if (!inputContent) {
|
|
80
|
+
throw new Error('Input content is empty');
|
|
81
|
+
}
|
|
82
|
+
if (!outputContent) {
|
|
83
|
+
throw new Error('Output content is empty');
|
|
84
|
+
}
|
|
85
|
+
// Build messages array
|
|
86
|
+
const messages = [];
|
|
87
|
+
if (config.systemPrompt) {
|
|
88
|
+
messages.push({
|
|
89
|
+
role: 'system',
|
|
90
|
+
content: config.systemPrompt,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
messages.push({
|
|
94
|
+
role: 'user',
|
|
95
|
+
content: inputContent,
|
|
96
|
+
});
|
|
97
|
+
messages.push({
|
|
98
|
+
role: 'assistant',
|
|
99
|
+
content: outputContent,
|
|
100
|
+
});
|
|
101
|
+
// Generate next ID
|
|
102
|
+
const examplesPath = join(cwd, EXAMPLES_FILE);
|
|
103
|
+
let nextId = 1;
|
|
104
|
+
try {
|
|
105
|
+
const existing = await readExamples(examplesPath);
|
|
106
|
+
if (existing.length > 0) {
|
|
107
|
+
const maxId = Math.max(...existing.map((e) => e.id));
|
|
108
|
+
nextId = maxId + 1;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
// File might be empty or not exist yet - start with ID 1
|
|
113
|
+
if (error.code !== 'ENOENT') {
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
// Create example
|
|
118
|
+
const example = {
|
|
119
|
+
id: nextId,
|
|
120
|
+
messages,
|
|
121
|
+
rating: null,
|
|
122
|
+
createdAt: new Date().toISOString(),
|
|
123
|
+
version: 1,
|
|
124
|
+
};
|
|
125
|
+
// Validate messages
|
|
126
|
+
if (example.messages.length === 0) {
|
|
127
|
+
throw new Error('Messages array cannot be empty');
|
|
128
|
+
}
|
|
129
|
+
for (const msg of example.messages) {
|
|
130
|
+
if (!['system', 'user', 'assistant'].includes(msg.role)) {
|
|
131
|
+
throw new Error(`Invalid message role: ${msg.role}`);
|
|
132
|
+
}
|
|
133
|
+
if (!msg.content.trim()) {
|
|
134
|
+
throw new Error(`Message content cannot be empty for role: ${msg.role}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// Append to JSONL
|
|
138
|
+
await appendExample(examplesPath, example);
|
|
139
|
+
console.log(`✓ Added example #${nextId}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
+
{"version":3,"file":"add.test.d.ts","sourceRoot":"","sources":["../../src/commands/add.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
|
2
|
+
import { writeFile, readFile, mkdtemp, rm, mkdir } from 'node:fs/promises';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import inquirer from 'inquirer';
|
|
6
|
+
import { Command } from 'commander';
|
|
7
|
+
import { registerAdd } from './add.js';
|
|
8
|
+
describe('ft add', () => {
|
|
9
|
+
let testDir;
|
|
10
|
+
let originalCwd;
|
|
11
|
+
beforeEach(async () => {
|
|
12
|
+
// Create a temporary directory for each test
|
|
13
|
+
testDir = await mkdtemp(join(tmpdir(), 'ft-add-test-'));
|
|
14
|
+
originalCwd = process.cwd();
|
|
15
|
+
process.chdir(testDir);
|
|
16
|
+
// Create basic project structure
|
|
17
|
+
const config = {
|
|
18
|
+
name: 'test-project',
|
|
19
|
+
provider: 'together',
|
|
20
|
+
model: 'meta-llama/Llama-3.3-70B-Instruct',
|
|
21
|
+
qualityThreshold: 8,
|
|
22
|
+
runs: [],
|
|
23
|
+
};
|
|
24
|
+
await writeFile('.ftpipeline.json', JSON.stringify(config, null, 2));
|
|
25
|
+
await mkdir('data', { recursive: true });
|
|
26
|
+
await writeFile('data/examples.jsonl', '');
|
|
27
|
+
});
|
|
28
|
+
afterEach(async () => {
|
|
29
|
+
process.chdir(originalCwd);
|
|
30
|
+
await rm(testDir, { recursive: true, force: true });
|
|
31
|
+
vi.restoreAllMocks();
|
|
32
|
+
});
|
|
33
|
+
it('should add an example in file mode', async () => {
|
|
34
|
+
// Create input and output files
|
|
35
|
+
await writeFile('input.txt', 'What is the capital of France?');
|
|
36
|
+
await writeFile('output.txt', 'The capital of France is Paris.');
|
|
37
|
+
const program = new Command();
|
|
38
|
+
registerAdd(program);
|
|
39
|
+
await program.parseAsync(['node', 'test', 'add', '-i', 'input.txt', '-o', 'output.txt']);
|
|
40
|
+
// Verify example was appended
|
|
41
|
+
const content = await readFile('data/examples.jsonl', 'utf-8');
|
|
42
|
+
const lines = content.trim().split('\n');
|
|
43
|
+
expect(lines).toHaveLength(1);
|
|
44
|
+
const example = JSON.parse(lines[0]);
|
|
45
|
+
expect(example.id).toBe(1);
|
|
46
|
+
expect(example.messages).toHaveLength(2);
|
|
47
|
+
expect(example.messages[0]).toEqual({
|
|
48
|
+
role: 'user',
|
|
49
|
+
content: 'What is the capital of France?',
|
|
50
|
+
});
|
|
51
|
+
expect(example.messages[1]).toEqual({
|
|
52
|
+
role: 'assistant',
|
|
53
|
+
content: 'The capital of France is Paris.',
|
|
54
|
+
});
|
|
55
|
+
expect(example.rating).toBeNull();
|
|
56
|
+
expect(example.version).toBe(1);
|
|
57
|
+
expect(example.createdAt).toBeDefined();
|
|
58
|
+
});
|
|
59
|
+
it('should add an example in interactive mode', async () => {
|
|
60
|
+
// Mock inquirer prompts
|
|
61
|
+
vi.spyOn(inquirer, 'prompt').mockResolvedValue({
|
|
62
|
+
input: 'What is 2 + 2?',
|
|
63
|
+
output: '2 + 2 equals 4.',
|
|
64
|
+
});
|
|
65
|
+
const program = new Command();
|
|
66
|
+
registerAdd(program);
|
|
67
|
+
await program.parseAsync(['node', 'test', 'add']);
|
|
68
|
+
// Verify example was appended
|
|
69
|
+
const content = await readFile('data/examples.jsonl', 'utf-8');
|
|
70
|
+
const lines = content.trim().split('\n');
|
|
71
|
+
expect(lines).toHaveLength(1);
|
|
72
|
+
const example = JSON.parse(lines[0]);
|
|
73
|
+
expect(example.id).toBe(1);
|
|
74
|
+
expect(example.messages).toHaveLength(2);
|
|
75
|
+
expect(example.messages[0].content).toBe('What is 2 + 2?');
|
|
76
|
+
expect(example.messages[1].content).toBe('2 + 2 equals 4.');
|
|
77
|
+
});
|
|
78
|
+
it('should generate sequential IDs', async () => {
|
|
79
|
+
// Add first example
|
|
80
|
+
await writeFile('input1.txt', 'Question 1');
|
|
81
|
+
await writeFile('output1.txt', 'Answer 1');
|
|
82
|
+
const program1 = new Command();
|
|
83
|
+
registerAdd(program1);
|
|
84
|
+
await program1.parseAsync(['node', 'test', 'add', '-i', 'input1.txt', '-o', 'output1.txt']);
|
|
85
|
+
// Add second example
|
|
86
|
+
await writeFile('input2.txt', 'Question 2');
|
|
87
|
+
await writeFile('output2.txt', 'Answer 2');
|
|
88
|
+
const program2 = new Command();
|
|
89
|
+
registerAdd(program2);
|
|
90
|
+
await program2.parseAsync(['node', 'test', 'add', '-i', 'input2.txt', '-o', 'output2.txt']);
|
|
91
|
+
// Verify IDs are sequential
|
|
92
|
+
const content = await readFile('data/examples.jsonl', 'utf-8');
|
|
93
|
+
const lines = content.trim().split('\n');
|
|
94
|
+
expect(lines).toHaveLength(2);
|
|
95
|
+
const example1 = JSON.parse(lines[0]);
|
|
96
|
+
const example2 = JSON.parse(lines[1]);
|
|
97
|
+
expect(example1.id).toBe(1);
|
|
98
|
+
expect(example2.id).toBe(2);
|
|
99
|
+
});
|
|
100
|
+
it('should prepend system prompt if configured', async () => {
|
|
101
|
+
// Update config with system prompt
|
|
102
|
+
const config = {
|
|
103
|
+
name: 'test-project',
|
|
104
|
+
provider: 'together',
|
|
105
|
+
model: 'meta-llama/Llama-3.3-70B-Instruct',
|
|
106
|
+
systemPrompt: 'You are a helpful assistant.',
|
|
107
|
+
qualityThreshold: 8,
|
|
108
|
+
runs: [],
|
|
109
|
+
};
|
|
110
|
+
await writeFile('.ftpipeline.json', JSON.stringify(config, null, 2));
|
|
111
|
+
await writeFile('input.txt', 'Hello');
|
|
112
|
+
await writeFile('output.txt', 'Hi there!');
|
|
113
|
+
const program = new Command();
|
|
114
|
+
registerAdd(program);
|
|
115
|
+
await program.parseAsync(['node', 'test', 'add', '-i', 'input.txt', '-o', 'output.txt']);
|
|
116
|
+
const content = await readFile('data/examples.jsonl', 'utf-8');
|
|
117
|
+
const example = JSON.parse(content.trim());
|
|
118
|
+
expect(example.messages).toHaveLength(3);
|
|
119
|
+
expect(example.messages[0]).toEqual({
|
|
120
|
+
role: 'system',
|
|
121
|
+
content: 'You are a helpful assistant.',
|
|
122
|
+
});
|
|
123
|
+
expect(example.messages[1].role).toBe('user');
|
|
124
|
+
expect(example.messages[2].role).toBe('assistant');
|
|
125
|
+
});
|
|
126
|
+
it('should trim whitespace from input and output', async () => {
|
|
127
|
+
await writeFile('input.txt', '\n\n What is AI? \n\n');
|
|
128
|
+
await writeFile('output.txt', '\n Artificial Intelligence \n');
|
|
129
|
+
const program = new Command();
|
|
130
|
+
registerAdd(program);
|
|
131
|
+
await program.parseAsync(['node', 'test', 'add', '-i', 'input.txt', '-o', 'output.txt']);
|
|
132
|
+
const content = await readFile('data/examples.jsonl', 'utf-8');
|
|
133
|
+
const example = JSON.parse(content.trim());
|
|
134
|
+
expect(example.messages[0].content).toBe('What is AI?');
|
|
135
|
+
expect(example.messages[1].content).toBe('Artificial Intelligence');
|
|
136
|
+
});
|
|
137
|
+
it('should fail if project is not initialized', async () => {
|
|
138
|
+
// Remove config file
|
|
139
|
+
await rm('.ftpipeline.json');
|
|
140
|
+
const mockExit = vi.spyOn(process, 'exit').mockImplementation(() => {
|
|
141
|
+
throw new Error('process.exit called');
|
|
142
|
+
});
|
|
143
|
+
const consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => { });
|
|
144
|
+
await writeFile('input.txt', 'test');
|
|
145
|
+
await writeFile('output.txt', 'test');
|
|
146
|
+
const program = new Command();
|
|
147
|
+
registerAdd(program);
|
|
148
|
+
await expect(program.parseAsync(['node', 'test', 'add', '-i', 'input.txt', '-o', 'output.txt'])).rejects.toThrow('process.exit called');
|
|
149
|
+
expect(consoleErrorSpy).toHaveBeenCalledWith(expect.stringContaining('Project not initialized'));
|
|
150
|
+
expect(mockExit).toHaveBeenCalledWith(1);
|
|
151
|
+
});
|
|
152
|
+
it('should fail if only --input is provided', async () => {
|
|
153
|
+
const mockExit = vi.spyOn(process, 'exit').mockImplementation(() => {
|
|
154
|
+
throw new Error('process.exit called');
|
|
155
|
+
});
|
|
156
|
+
const consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => { });
|
|
157
|
+
await writeFile('input.txt', 'test');
|
|
158
|
+
const program = new Command();
|
|
159
|
+
registerAdd(program);
|
|
160
|
+
await expect(program.parseAsync(['node', 'test', 'add', '-i', 'input.txt'])).rejects.toThrow('process.exit called');
|
|
161
|
+
expect(consoleErrorSpy).toHaveBeenCalledWith(expect.stringContaining('Both --input and --output must be provided together'));
|
|
162
|
+
expect(mockExit).toHaveBeenCalledWith(1);
|
|
163
|
+
});
|
|
164
|
+
it('should fail if only --output is provided', async () => {
|
|
165
|
+
const mockExit = vi.spyOn(process, 'exit').mockImplementation(() => {
|
|
166
|
+
throw new Error('process.exit called');
|
|
167
|
+
});
|
|
168
|
+
const consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => { });
|
|
169
|
+
await writeFile('output.txt', 'test');
|
|
170
|
+
const program = new Command();
|
|
171
|
+
registerAdd(program);
|
|
172
|
+
await expect(program.parseAsync(['node', 'test', 'add', '-o', 'output.txt'])).rejects.toThrow('process.exit called');
|
|
173
|
+
expect(consoleErrorSpy).toHaveBeenCalledWith(expect.stringContaining('Both --input and --output must be provided together'));
|
|
174
|
+
expect(mockExit).toHaveBeenCalledWith(1);
|
|
175
|
+
});
|
|
176
|
+
it('should fail if input is empty', async () => {
|
|
177
|
+
const mockExit = vi.spyOn(process, 'exit').mockImplementation(() => {
|
|
178
|
+
throw new Error('process.exit called');
|
|
179
|
+
});
|
|
180
|
+
const consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => { });
|
|
181
|
+
await writeFile('input.txt', ' \n \n ');
|
|
182
|
+
await writeFile('output.txt', 'test');
|
|
183
|
+
const program = new Command();
|
|
184
|
+
registerAdd(program);
|
|
185
|
+
await expect(program.parseAsync(['node', 'test', 'add', '-i', 'input.txt', '-o', 'output.txt'])).rejects.toThrow('process.exit called');
|
|
186
|
+
expect(consoleErrorSpy).toHaveBeenCalledWith(expect.stringContaining('Input content is empty'));
|
|
187
|
+
expect(mockExit).toHaveBeenCalledWith(1);
|
|
188
|
+
});
|
|
189
|
+
it('should fail if output is empty', async () => {
|
|
190
|
+
const mockExit = vi.spyOn(process, 'exit').mockImplementation(() => {
|
|
191
|
+
throw new Error('process.exit called');
|
|
192
|
+
});
|
|
193
|
+
const consoleErrorSpy = vi.spyOn(console, 'error').mockImplementation(() => { });
|
|
194
|
+
await writeFile('input.txt', 'test');
|
|
195
|
+
await writeFile('output.txt', ' \n \n ');
|
|
196
|
+
const program = new Command();
|
|
197
|
+
registerAdd(program);
|
|
198
|
+
await expect(program.parseAsync(['node', 'test', 'add', '-i', 'input.txt', '-o', 'output.txt'])).rejects.toThrow('process.exit called');
|
|
199
|
+
expect(consoleErrorSpy).toHaveBeenCalledWith(expect.stringContaining('Output content is empty'));
|
|
200
|
+
expect(mockExit).toHaveBeenCalledWith(1);
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
//# sourceMappingURL=add.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add.test.js","sourceRoot":"","sources":["../../src/commands/add.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAGvC,QAAQ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