Repository navigation
Expand file tree
/
Copy pathvitest.config.ts
More file actions
93 lines (91 loc) · 5 KB
/
Copy pathvitest.config.ts
File metadata and controls
93 lines (91 loc) · 5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
import { defineConfig } from 'vitest/config';
import path from 'path';
export default defineConfig({
test: {
// A late console.* must not redden a green suite (#10374): vitest's worker
// forwards console output over RPC and discards the promise, and a write
// landing after teardown's rpcDone() snapshot is rejected into an unhandled
// error — a fully green run that exits 1. Disarming removes the mechanism.
// Mechanism + measured costs: examples/app-showcase/vitest.config.ts.
// Enforced repo-wide by scripts/check-console-intercept-disarm.mjs.
disableConsoleIntercept: true,
globals: true,
environment: 'node',
// #13517: quiet the registry's per-item registration chatter — the
// engine's own `OS_REGISTRY_LOG` seam, not a change to its shipped
// default. Enforced by scripts/check-registry-log-declared.mjs: the
// declared-positions seeder's suite constructs a `SchemaRegistry` to read
// the registry's own by-name precedence.
env: { OS_REGISTRY_LOG: 'warn' },
},
resolve: {
// [#8577] Both entries were added for the suite that drove the real
// `syncAudienceBindingSuggestions` against a real `ObjectQL` engine over a real
// `SqlDriver` (retired with the deployment-level acceptance, #22801 → A); every
// suite here that imports these sibling packages as VALUES still relies on them.
//
// Unaliased, those two specifiers resolve through the workspace link to `dist/` —
// a BUILD ARTIFACT — which would make this suite's verdict a function of build
// state rather than of the source in the checkout. The loud failure (missing
// export) is the mild half; a dist merely BEHIND runs GREEN against the
// dependency's old behaviour and says nothing. That is the exact hazard here:
// this suite's subject is the interaction between a DECLARED index's scope and
// the driver that materializes it, so a stale `driver-sql` would report the
// pre-fix installation-wide index as per-organization — the #8577 defect itself,
// passing.
//
// Turbo already orders `test` after `^build`, so `turbo run test` was never the
// failing path. The paths it does not mediate are: `pnpm test` inside this
// package, `vitest run <file>`, an editor runner, or an agent working in a tree
// built at an older commit — precisely the ways this pin gets re-run WHILE
// someone is changing the index scope or the drift arm.
//
// Array form with anchored patterns, deliberately: the object form matches by
// PREFIX, so a bare key with a FILE replacement would also swallow any subpath
// import and resolve it to `…/src/index.ts/<subpath>` (ENOTDIR) at run time, in
// a config that looks right.
alias: [
{
find: /^@objectstack\/driver-sql$/,
replacement: path.resolve(__dirname, '../../drivers/driver-sql/src/index.ts'),
},
{
find: /^@objectstack\/objectql$/,
replacement: path.resolve(__dirname, '../../objectql/src/index.ts'),
},
// [#11184] `bootstrap-platform-admin.ts` imports `@objectstack/types` as
// a VALUE (`resolveTenancyPosture` / `resolvePlatformOwnerEmail`), so
// its suites must read the producer's source in this checkout rather
// than `dist/` — a stale dist would run GREEN against the dependency's
// old behaviour (`check:test-source-alias` refuses exactly that).
{
find: /^@objectstack\/types$/,
replacement: path.resolve(__dirname, '../../types/src/index.ts'),
},
// [#11843] `packaged-permission-set-lock-gate.test.ts` drives the REAL
// `ObjectStackProtocolImplementation` (its `saveMetaItem` seam is the
// door under test), so the protocol must be read from the producer's
// source in this checkout — a stale `dist/` would run the pin against a
// seam that predates `registerAuthoringGate('permission', ...)` and
// report a verdict about the last build rather than about this tree.
{
find: /^@objectstack\/metadata-protocol$/,
replacement: path.resolve(__dirname, '../../metadata-protocol/src/index.ts'),
},
// [#16608] `insert-check-post-image.test.ts` imports `SqliteWasmDriver`
// as a VALUE: its conformance cell runs on two driver families, because
// "the check judges the row that will be stored" is a claim about the
// write gate that must not turn out to depend on which backend a
// deployment happens to run. Same reason as `driver-sql` above — left
// unaliased the specifier resolves through the workspace link to `dist/`,
// a BUILD ARTIFACT, and a dist merely BEHIND runs GREEN against the
// driver's old behaviour while saying nothing (`check:test-source-alias`
// refuses exactly that).
{
find: /^@objectstack\/driver-sqlite-wasm$/,
replacement: path.resolve(__dirname, '../../drivers/driver-sqlite-wasm/src/index.ts'),
},
],
},
});