UNPKG

arela

Version:

AI-powered CTO with multi-agent orchestration, code summarization, visual testing (web + mobile) for blazing fast development.

69 lines 2.13 kB
import Dredd from 'dredd'; export async function runDredd(configuration) { return new Promise((resolve) => { try { const dredd = new Dredd(configuration); dredd.run((error, stats) => { if (error) { resolve({ stats: { total: stats?.total || 0, failures: stats?.failures || 0, errors: stats?.errors || 0, passes: stats?.passes || 0, skipped: stats?.skipped || 0, tests: stats?.tests || [], }, error, }); } else { resolve({ stats: { total: stats.total || 0, failures: stats.failures || 0, errors: stats.errors || 0, passes: stats.passes || 0, skipped: stats.skipped || 0, tests: stats.tests || [], }, }); } }); } catch (error) { resolve({ stats: { total: 0, failures: 0, errors: 1, passes: 0, skipped: 0, tests: [], }, error: error, }); } }); } export function getDreddConfig(specPath, serverUrl, hookfiles) { return { endpoint: serverUrl, path: [specPath], hookfiles: hookfiles || [], reporter: ['json'], output: [], header: [], sorted: false, user: null, 'inline-errors': false, details: true, method: [], only: [], color: true, loglevel: 'warning', timestamp: false, dry: false, }; } //# sourceMappingURL=dredd-runner.js.map