-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathvitest.config.ts
More file actions
83 lines (82 loc) · 4.08 KB
/
Copy pathvitest.config.ts
File metadata and controls
83 lines (82 loc) · 4.08 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
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,
// #13517 / #15425: quiet the SchemaRegistry's per-item registration
// chatter — the engine's OWN `OS_REGISTRY_LOG` seam
// (`SchemaRegistryOptions.logLevel` / `REGISTRY_LOG_LEVELS`, objectql's
// registry.ts), not a change to its shipped 'info' default and not a
// library that sniffs `process.env.VITEST`. This suite constructs bare
// registries in `packages-write-envelope.test.ts`, so every case pays a
// `[Registry] Registered …` line per registered item. The ADR-0005
// `[Registry] Collision` diagnostics go through a bare `console.warn` the
// level never gates, so a real shadowing still speaks here.
// Enforced by scripts/check-registry-log-declared.mjs.
env: { OS_REGISTRY_LOG: 'warn' },
// Exclude integration tests that require a running server
exclude: [
'**/node_modules/**',
'**/dist/**',
'tests/integration/**',
],
environment: 'node',
},
resolve: {
// [#12181] Both entries exist for `meta-delete-item-carriers.test.ts`, the
// suite here that drives the REAL reset door: it boots
// `ObjectStackProtocolImplementation` and registers the real
// `sys_metadata*` object definitions, so it imports two sibling packages as
// VALUES.
//
// Unaliased, those 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 (a missing export) is the mild half; a dist merely BEHIND
// lets the suite run GREEN against the producer's old behaviour with
// nothing in the output saying so, and this suite's whole job is to assert
// what the door and the protocol do with a carrier the client now sends.
// `pnpm check:test-source-alias` refuses exactly that.
//
// 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 and resolve it to `…/src/index.ts/<subpath>` (ENOTDIR) at run
// time, in a config that looks right.
alias: [
{
find: /^@objectstack\/metadata-core$/,
replacement: path.resolve(__dirname, '../metadata-core/src/index.ts'),
},
{
find: /^@objectstack\/metadata-protocol$/,
replacement: path.resolve(__dirname, '../metadata-protocol/src/index.ts'),
},
// [#12104] The three producers `analytics-automation-json-erasure.test.ts`
// DRIVES to measure what the five `return res.json()` methods really
// resolve to. Same reason as the pair above, plus one specific to that
// suite: its whole claim is "the annotation matches what the producer
// sends", so it must read the producer IN THIS CHECKOUT. Against `dist/`
// a producer whose envelope had already changed in source would keep the
// suite green on the old shape — certifying a declaration that is by then
// false, which is precisely the failure the annotations exist to prevent.
{
find: /^@objectstack\/rest$/,
replacement: path.resolve(__dirname, '../rest/src/index.ts'),
},
{
find: /^@objectstack\/service-analytics$/,
replacement: path.resolve(__dirname, '../services/service-analytics/src/index.ts'),
},
{
find: /^@objectstack\/service-automation$/,
replacement: path.resolve(__dirname, '../services/service-automation/src/index.ts'),
},
],
},
});