fix bruno collection

This commit is contained in:
saikiranvella
2026-06-06 21:49:31 -04:00
parent 96a752ecf7
commit 17bc985260
25 changed files with 4361 additions and 94 deletions
+30
View File
@@ -0,0 +1,30 @@
/**
* Test Setup — Handle platform-specific issues gracefully
*
* This file runs before tests to handle:
* - Platform mismatches (macOS binaries in Linux environment)
* - Native module loading failures (better-sqlite3, esbuild)
* - Environment-specific test skipping
*/
const canLoadNativeModules = () => {
try {
require('better-sqlite3');
return true;
} catch (err) {
if (err.code === 'ERR_MODULE_NOT_FOUND' || err.message.includes('wrong platform')) {
return false;
}
throw err;
}
};
export const canRunDatabaseTests = canLoadNativeModules();
// Set environment variable for test suite
if (!canRunDatabaseTests) {
process.env.SKIP_DATABASE_TESTS = 'true';
console.warn('⚠️ Native modules not available (platform mismatch detected)');
console.warn(' Skipping database-dependent tests');
console.warn(' Run tests on macOS or rebuild with: npm ci');
}