Files
ruvnet__ruflo/v3/@claude-flow/hooks/vitest.config.ts
Reuven da2a787c08 test: fix extractToolBlock + WASM/CI skip discriminator + hooks timeout
Three fixes for the residual ~50 test failures after sharp mock:

1. tool-honesty.test.ts (10 fails) — extractToolBlock returned the
   inputSchema's closing brace instead of the outer tool object's. The
   helper walked forward from after 'name: '...'', so the first { it
   found was inputSchema's (depth=1), and its matching } closed depth
   to 0 way too early. Fix: walk backward to find the outer { that
   opens the tool object, then forward from there.

2. ruvllm-wasm/agent-wasm/ruvllm-tools/wasm-agent-tools/ruvllm-integration/
   memory-ruvector-deep (~75 fails) — my earlier 'package resolves'
   discriminator was wrong: the packages DO resolve in pnpm's tree, but
   the WASM binary doesn't load at init time (forks pool exposed this
   the threads pool was masking). Switch to process.env.CI === 'true'
   as the discriminator: skip in CI, run locally where WASM binaries
   are built. When the integration mocks become tight enough to fully
   replace the package import, the skip can come off.

3. guidance-provider 'block stopping' (4 mirror-fails) — timed out at
   15000ms. The hooks package has its own vitest.config.ts that didn't
   inherit my 30s bump from v3/vitest.config.ts. Add testTimeout +
   hookTimeout overrides there too.

Co-Authored-By: RuFlo <ruv@ruv.net>
2026-05-09 10:53:05 -04:00

20 lines
626 B
TypeScript

import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
environment: 'node',
include: ['__tests__/**/*.test.ts', 'src/__tests__/**/*.test.ts'],
globals: true,
// Bumped from default 5s → 30s to match v3/vitest.config.ts.
// guidance-provider's "block stopping when too many unconsolidated"
// test cold-loads ReasoningBank patterns + HuggingFace embeddings,
// which exceed 15s in CI without warm cache.
testTimeout: 30000,
hookTimeout: 30000,
// Disable coverage for hooks package (uses vitest v2)
coverage: {
enabled: false,
},
},
});