-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-parser.js
More file actions
43 lines (34 loc) · 1.38 KB
/
test-parser.js
File metadata and controls
43 lines (34 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/env node
// Simple test script to verify CSV parsing without GitHub authentication
import { parseCsvFile } from './dist/utils/csv-parser.js';
import { validateCsvData } from './dist/utils/validators.js';
import chalk from 'chalk';
async function testParser(csvFile) {
try {
console.log(chalk.blue.bold('🧪 Testing CSV Parser\n'));
console.log(chalk.gray(`Parsing: ${csvFile}`));
const issues = await parseCsvFile(csvFile);
console.log(chalk.green(`✅ Parsed ${issues.length} issues\n`));
validateCsvData(issues);
// Display parsed issues
issues.forEach((issue, index) => {
console.log(chalk.cyan(`${index + 1}. ${issue.title}`));
if (issue.body) {
console.log(chalk.gray(` ${issue.body.substring(0, 100)}${issue.body.length > 100 ? '...' : ''}`));
}
if (issue.labels && issue.labels.length > 0) {
console.log(chalk.yellow(` Labels: ${issue.labels.join(', ')}`));
}
if (issue.assignees && issue.assignees.length > 0) {
console.log(chalk.magenta(` Assignees: ${issue.assignees.join(', ')}`));
}
console.log();
});
console.log(chalk.green.bold('✅ All tests passed!'));
} catch (error) {
console.error(chalk.red('❌ Error:'), error.message);
process.exit(1);
}
}
const csvFile = process.argv[2] || 'example.csv';
testParser(csvFile);