Files
ALL-teach_sys/frontend_视觉设计/verifyUpdate.cjs

59 lines
2.1 KiB
JavaScript
Raw Normal View History

#!/usr/bin/env node
const fs = require('fs');
const content = fs.readFileSync('src/mocks/resumeInterviewMock.js', 'utf-8');
const industries = [
'UI设计', '包装设计', '插画设计', '灯光', '动画设计',
'后期特效', '剪辑', '品牌设计', '平面设计', '三维设计',
'摄影/摄像', '室内设计', '调色', '新媒体运营', '音频处理',
'影视节目策划', '直播'
];
console.log('=== Verification of Interview Questions Update ===\n');
let allSuccess = true;
industries.forEach(industry => {
const regex = new RegExp('"name":\\s*"' + industry.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + '"[\\s\\S]*?"questions":\\s*\\[([\\s\\S]*?)\\]', 'g');
const match = regex.exec(content);
if (match) {
const questionsContent = match[1];
const hasGroupQ1 = questionsContent.includes('group_q1');
const hasSubQuestions = questionsContent.includes('subQuestions');
const questionCount = (questionsContent.match(/"q1_\d+"/g) || []).length;
// Extract first question to verify content
const firstQuestionMatch = questionsContent.match(/"question":\s*"([^"]+)"/);
const firstQuestion = firstQuestionMatch ? firstQuestionMatch[1].substring(0, 30) : '';
if (hasGroupQ1 && hasSubQuestions && questionCount > 0) {
console.log(`${industry.padEnd(15)} : Updated (${questionCount} questions) - "${firstQuestion}..."`);
} else {
console.log(`⚠️ ${industry.padEnd(15)} : Structure issue`);
allSuccess = false;
}
} else {
console.log(`${industry.padEnd(15)} : Not found`);
allSuccess = false;
}
});
console.log('\n' + '='.repeat(50));
if (allSuccess) {
console.log('✅ All 17 industry groups have been successfully updated!');
} else {
console.log('⚠️ Some industry groups may need attention');
}
// Check if the file is syntactically valid
const { execSync } = require('child_process');
try {
execSync('node -c src/mocks/resumeInterviewMock.js', { encoding: 'utf-8' });
console.log('✅ File syntax is valid');
} catch (error) {
console.error('❌ Syntax error in file');
}