import '../assert_dev_env.js';
/**
 * Capability vocabulary for cross-backend integration testing.
 *
 * Backends declare which optional behaviors they support; suite bodies
 * call `test_if(capabilities.X, ...)` to skip cases the backend doesn't
 * implement. No `if (config.name === 'rust')` branches anywhere — name-
 * checking is a code smell that says capability vocabulary is missing.
 *
 * In-process Hono via `default_in_process_setup` declares every
 * capability `true` (see `in_process_capabilities`). Cross-process
 * backends opt in per-flag on their `BackendConfig`.
 *
 * @module
 */
import { test } from 'vitest';
/**
 * Capability declarations for the in-process Hono transport. Every flag
 * is `true` because in-process testing exercises the full backend with
 * no missing optional behaviors. Cross-process consumers
 * declare each flag explicitly per backend.
 */
export const in_process_capabilities = Object.freeze({
    bearer_auth: true,
    trusted_proxy: true,
    login_rate_limit: true,
    ws: true,
    sse: true,
    cell_crud: true,
    cell_relations: true,
    account_lifecycle: true,
});
/**
 * Conditional `test()` wrapper — registers a vitest case only when
 * `cond` is true; otherwise registers it as `.skip` so the run still
 * surfaces the gated coverage in the report.
 *
 * Thin wrapper around vitest's `test.skipIf(!cond)` with the argument
 * order flipped to match the more readable `test_if(capabilities.bearer_auth, ...)`
 * call pattern.
 */
export const test_if = (cond, name, fn) => {
    if (cond) {
        test(name, fn);
    }
    else {
        test.skip(name, fn);
    }
};
