@pure0cd/freefire-api
Version:
A powerful Node.js library to interact with Garena Free Fire API using Protobuf. Login, Search Players, and get Profile Stats.
33 lines (27 loc) • 1.1 kB
JavaScript
const { execSync } = require('child_process');
const tests = [
'test/login.js',
'test/search.js',
'test/profile.js',
'test/stats.js',
'test/items.js'
];
console.log("Running all tests sequentially...\n");
for (const testFile of tests) {
const testName = testFile.split('/')[1];
console.log(`-------------- ${testName}:`);
try {
// Execute the script synchronously and inherit stdio properly to preserve colors/output
execSync(`node ${testFile}`, { stdio: 'inherit' });
console.log("\n"); // Add spacing between tests
} catch (error) {
console.error(`[!] Test ${testName} failed.`);
// Decide if we want to stop or continue.
// Usually 'all tests' implies running them all, but if one fails in CI you might want exit 1.
// For local dev convenience, let's just log and continue or output usage.
// But execSync throws if command fails.
// We'll let it exit with error code if a test fails so the user knows.
process.exit(1);
}
}
console.log("All tests passed successfully!");