-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathvitest.config.ts
More file actions
42 lines (39 loc) · 1.91 KB
/
Copy pathvitest.config.ts
File metadata and controls
42 lines (39 loc) · 1.91 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
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
const here = path.dirname(fileURLToPath(import.meta.url));
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,
environment: 'node',
testTimeout: 10_000,
alias: [
// The human-user predicate agreement pin drives plugin-security's
// `bootstrapPlatformAdmin` to read its hand-spelled `isHumanUser`. A pin
// is a verdict about the SOURCE in this checkout, so the specifier
// resolves to `src/` rather than to a `dist/` that may predate the edit
// under test. Anchored (`^…$`, array form) so the entry cannot swallow
// subpath specifiers.
{
find: /^@objectstack\/plugin-security$/,
replacement: path.resolve(here, '../plugin-security/src/index.ts'),
},
// [#14762] `auth-manager.ts` takes a VALUE import on
// `@objectstack/service-messaging` (`normalizeRecipientLocale`). Same
// reason as the entry above, and the same anchoring: a unit test is a
// verdict about the SOURCE in this checkout, so the specifier must not
// resolve to a `dist/` that may predate the edit under test.
{
find: /^@objectstack\/service-messaging$/,
replacement: path.resolve(here, '../../services/service-messaging/src/index.ts'),
},
],
},
});