Skip to content

Commit b6312fe

Browse files
committed
test(connector-mcp): read objectql, driver-sql and platform-objects from source in tests
The store-backed test imports the three; check:test-source-alias requires an anchored source alias for each rather than a wider unaliased ledger. The registry log is quieted through OS_REGISTRY_LOG. Claude-Session: https://claude.ai/code/session_017xRBcVBKAFk1ntXSjvPt7U Co-authored-by: Claude <noreply@anthropic.com>
1 parent a51f129 commit b6312fe

1 file changed

Lines changed: 33 additions & 2 deletions

File tree

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
11
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
22

3-
// This package needs nothing beyond the shared preset; see its header.
4-
export { default } from '../../../vitest.preset.mts';
3+
import { defineConfig } from 'vitest/config';
4+
import path from 'node:path';
5+
import { fileURLToPath } from 'node:url';
6+
7+
const HERE = path.dirname(fileURLToPath(import.meta.url));
8+
9+
export default defineConfig({
10+
test: {
11+
// A late console.* must not redden a green suite (#10374): vitest's worker
12+
// forwards console output over RPC and discards the promise, and a write
13+
// landing after teardown's rpcDone() snapshot is rejected into an unhandled
14+
// error — a fully green run that exits 1. Disarming removes the mechanism.
15+
// Mechanism + measured costs: examples/app-showcase/vitest.config.ts.
16+
// Enforced repo-wide by scripts/check-console-intercept-disarm.mjs.
17+
disableConsoleIntercept: true,
18+
// `mcp-include-credential-scope.test.ts` boots the credential store on a
19+
// real ObjectQL, whose registry logs one line per registered item; quiet
20+
// it through the engine's own `OS_REGISTRY_LOG` seam, not a change to its
21+
// shipped default (scripts/check-registry-log-declared.mjs).
22+
env: { OS_REGISTRY_LOG: 'warn' },
23+
},
24+
resolve: {
25+
// The store-backed test reads these three from SOURCE, so its verdict is
26+
// about the checkout, never about whatever `dist/` was last built
27+
// (`pnpm check:test-source-alias`). Anchored, array form: a bare string
28+
// key matches by prefix and would swallow the subpaths.
29+
alias: [
30+
{ find: /^@objectstack\/driver-sql$/, replacement: path.resolve(HERE, '../../drivers/driver-sql/src/index.ts') },
31+
{ find: /^@objectstack\/objectql$/, replacement: path.resolve(HERE, '../../objectql/src/index.ts') },
32+
{ find: /^@objectstack\/platform-objects$/, replacement: path.resolve(HERE, '../../platform-objects/src/index.ts') },
33+
],
34+
},
35+
});

0 commit comments

Comments
 (0)