-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-runner.js
More file actions
executable file
·45 lines (37 loc) · 1.21 KB
/
test-runner.js
File metadata and controls
executable file
·45 lines (37 loc) · 1.21 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
#!/usr/bin/env node
/**
* Test Runner for Multi-Domain Example
*
* Runs tests for all domains or a specific domain.
* Usage:
* node test-runner.js # Run all tests
* node test-runner.js frontend # Run only frontend tests
*/
const domains = ['frontend', 'backend', 'api', 'shared'];
const requestedDomain = process.argv[2];
console.log('🧪 Running tests...\n');
function runTestsForDomain(domain) {
console.log(`Testing ${domain} domain:`);
console.log(` ✓ Loading ${domain} modules`);
console.log(` ✓ Running unit tests`);
console.log(` ✓ Running integration tests`);
console.log(` ✓ All ${domain} tests passed\n`);
}
if (requestedDomain) {
// Run tests for specific domain
if (!domains.includes(requestedDomain)) {
console.error(`❌ Unknown domain: ${requestedDomain}`);
console.error(`Available domains: ${domains.join(', ')}`);
process.exit(1);
}
console.log(`Running tests for ${requestedDomain} domain only\n`);
runTestsForDomain(requestedDomain);
} else {
// Run all tests
console.log('Running tests for all domains\n');
domains.forEach(runTestsForDomain);
}
// Summary
console.log('='.repeat(50));
console.log('✅ All tests passed!');
process.exit(0);