-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest-setup.js
More file actions
executable file
·67 lines (59 loc) · 1.45 KB
/
test-setup.js
File metadata and controls
executable file
·67 lines (59 loc) · 1.45 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env node
/**
* Simple script for testing code quality setup
*/
/* eslint-disable @typescript-eslint/no-var-requires, no-console */
const { execSync } = require('child_process');
console.log('🧪 Testing code quality setup...\n');
const tests = [
{
name: 'TypeScript compilation',
command: 'npm run type-check',
emoji: '🔍',
},
{
name: 'ESLint check',
command: 'npm run lint',
emoji: '🧹',
},
{
name: 'Prettier formatting',
command: 'npm run format',
emoji: '💅',
},
{
name: 'Tests',
command: 'npm test -- --watchAll=false --passWithNoTests',
emoji: '🧪',
},
{
name: 'Build',
command: 'npm run build',
emoji: '🏗️',
},
];
let passed = 0;
let failed = 0;
for (const test of tests) {
try {
console.log(`${test.emoji} Running: ${test.name}...`);
execSync(test.command, { stdio: 'pipe' });
console.log(`✅ ${test.name} - PASSED\n`);
passed++;
} catch (error) {
console.log(`❌ ${test.name} - FAILED`);
console.log(` Error: ${error.message.split('\n')[0]}\n`);
failed++;
}
}
console.log('📊 Results:');
console.log(`✅ Passed: ${passed}`);
console.log(`❌ Failed: ${failed}`);
if (failed === 0) {
console.log('\n🎉 All quality checks passed successfully!');
console.log('Setup is ready to use.');
} else {
console.log('\n⚠️ Some checks failed.');
console.log('Run npm run quality:fix to fix issues.');
process.exit(1);
}