From dd8f11eb27e869679ba7cd89cf78c2afaa4d0a1f Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 25 Oct 2026 09:48:39 +0000 Subject: [PATCH] test: warm the function-body imports check:test-source-alias names, at module scope (objectstack#25763) In the merged tree (objectui under objectstack `ui/`) every `@objectstack/*` import in a ui test resolves to a workspace package's `dist`, and a first load paid inside a test body, a hook, a `vi.mock` factory or after `vi.resetModules()` bills a cold transform of that graph to a clocked window. objectstack's `check:test-source-alias` names these sites; each touched file now also loads the same specifier with a module-scope side-effect import, so the transform is paid during collection, which no test or hook timeout clocks. The dynamic imports stay where they are. Seven findings the gate also prints are left untouched: they are type-level `import('x').T` (four spec-symbol tripwires, a type alias, an annotation) or text inside a template-literal fixture, which never load at run time. The gate side is objectstack#25766. Part of objectstack#25763, part of objectstack#25677. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01N1dH2ywuFXe38A89awucwV --- .changeset/25763-warm-test-imports.md | 4 ++++ .../src/__tests__/masterDetailFormTypeManifest.test.ts | 3 +++ .../app-shell/src/__tests__/spec-symbol-parity.test.ts | 3 +++ .../__tests__/AppContent.deniedVsUnpublished.test.tsx | 3 +++ .../useConsoleActionRuntime.flowRowGuard-13397.test.tsx | 3 +++ .../src/views/ObjectView.listLinksPlural-11733.test.tsx | 3 +++ .../RecordDetailView.paramRuntimeParity-6431.test.tsx | 3 +++ .../MetadataTypeActions.paramDialogClose-6473.test.tsx | 3 +++ .../ResourceEditPage.requiredInGatedSection-6900.test.tsx | 3 +++ .../views/metadata-admin/clientValidation.optOuts.test.ts | 7 +++++++ .../clientValidation.retiredFormulaKey.test.ts | 3 +++ ...ewVariantInspector.requiredInGatedSection-6900.test.tsx | 3 +++ .../DataPillar.addFieldPopover-12516.test.tsx | 3 +++ .../studio-design/DataPillar.formToolbar-12451.test.tsx | 3 +++ .../views/studio-design/DataPillar.gridProjection.test.tsx | 3 +++ .../DataPillar.picklistServedOptions-10202.test.tsx | 3 +++ .../StudioDesignSurface.autosaveInFlight-11204.test.tsx | 3 +++ .../StudioDesignSurface.autosaveSwitch-11232.test.tsx | 3 +++ ...StudioDesignSurface.draftVersionConflict-11773.test.tsx | 3 +++ packages/auth/src/__tests__/auth-spec-parity.test.ts | 3 +++ .../ObjectCalendar.dataObjectArmRefused-8348.test.tsx | 3 +++ .../src/__tests__/ObjectMetricWidget.i18nLabel.test.tsx | 3 +++ .../src/__tests__/gridBareArrayDataRefused-8348.test.tsx | 3 +++ .../SchemaRenderer.concealmentGateFaultDiagnostic.test.tsx | 4 ++++ .../SchemaRenderer.disabledGateFaultDiagnostic.test.tsx | 4 ++++ ...SchemaRenderer.productionPredicateFaultWarning.test.tsx | 4 ++++ .../types/src/__tests__/registry-meta-carry-9102.test.ts | 3 +++ 27 files changed, 89 insertions(+) create mode 100644 .changeset/25763-warm-test-imports.md diff --git a/.changeset/25763-warm-test-imports.md b/.changeset/25763-warm-test-imports.md new file mode 100644 index 0000000000..6efee839db --- /dev/null +++ b/.changeset/25763-warm-test-imports.md @@ -0,0 +1,4 @@ +--- +--- + +Test-only change: the test files that `check:test-source-alias` named now load, at module scope, the `@objectstack/*` / `@object-ui/*` specifiers they otherwise first load inside a test body, a `vi.mock` factory or after `vi.resetModules()`, so the cold transform is paid during collection instead of inside a clocked window (objectstack#25763). No published behaviour changes. diff --git a/apps/console/src/__tests__/masterDetailFormTypeManifest.test.ts b/apps/console/src/__tests__/masterDetailFormTypeManifest.test.ts index 9269f49bb3..915b400431 100644 --- a/apps/console/src/__tests__/masterDetailFormTypeManifest.test.ts +++ b/apps/console/src/__tests__/masterDetailFormTypeManifest.test.ts @@ -24,6 +24,9 @@ * papering over it, so this file cannot be read as "the hole is closed". */ import { describe, it, expect } from 'vitest'; +// Module scope as well as where a test awaits it below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@objectstack/spec/ui'; import { ComponentRegistry } from '@object-ui/core'; import { manifestFromConfigs, validateTree } from '@object-ui/sdui-parser'; import type { Diagnostic, SchemaElement } from '@object-ui/sdui-parser'; diff --git a/packages/app-shell/src/__tests__/spec-symbol-parity.test.ts b/packages/app-shell/src/__tests__/spec-symbol-parity.test.ts index 72f944b699..eee08d08af 100644 --- a/packages/app-shell/src/__tests__/spec-symbol-parity.test.ts +++ b/packages/app-shell/src/__tests__/spec-symbol-parity.test.ts @@ -74,6 +74,9 @@ */ import { describe, it, expect } from 'vitest'; +// Module scope as well as where a test awaits it below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@objectstack/spec'; import ts from 'typescript'; import { createRequire } from 'node:module'; import { readFileSync } from 'node:fs'; diff --git a/packages/app-shell/src/console/__tests__/AppContent.deniedVsUnpublished.test.tsx b/packages/app-shell/src/console/__tests__/AppContent.deniedVsUnpublished.test.tsx index a2a575b4ba..a0094f025f 100644 --- a/packages/app-shell/src/console/__tests__/AppContent.deniedVsUnpublished.test.tsx +++ b/packages/app-shell/src/console/__tests__/AppContent.deniedVsUnpublished.test.tsx @@ -79,6 +79,9 @@ import '@testing-library/jest-dom/vitest'; import { describe, it, expect, vi, beforeEach } from 'vitest'; +// Module scope as well as in the `vi.mock` factory below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@object-ui/i18n/locales'; import React from 'react'; import { render, screen, waitFor } from '@testing-library/react'; import { MemoryRouter, Routes, Route, useLocation, useNavigate } from 'react-router-dom'; diff --git a/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowRowGuard-13397.test.tsx b/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowRowGuard-13397.test.tsx index 5e5c095d80..b17124339b 100644 --- a/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowRowGuard-13397.test.tsx +++ b/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowRowGuard-13397.test.tsx @@ -20,6 +20,9 @@ */ import { describe, it, expect, beforeEach, vi } from 'vitest'; +// Module scope as well as in the `vi.mock` factory below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@object-ui/i18n/locales'; import { render, screen, fireEvent, waitFor, renderHook, act } from '@testing-library/react'; import React from 'react'; diff --git a/packages/app-shell/src/views/ObjectView.listLinksPlural-11733.test.tsx b/packages/app-shell/src/views/ObjectView.listLinksPlural-11733.test.tsx index 6e5d725933..65fcaf6c4e 100644 --- a/packages/app-shell/src/views/ObjectView.listLinksPlural-11733.test.tsx +++ b/packages/app-shell/src/views/ObjectView.listLinksPlural-11733.test.tsx @@ -35,6 +35,9 @@ import * as React from 'react'; import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; +// Module scope as well as in the `vi.mock` factory below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@object-ui/react'; import { render, cleanup, screen, fireEvent } from '@testing-library/react'; import { MemoryRouter, Routes, Route, useLocation } from 'react-router-dom'; import { createI18n, I18nProvider } from '@object-ui/i18n'; diff --git a/packages/app-shell/src/views/RecordDetailView.paramRuntimeParity-6431.test.tsx b/packages/app-shell/src/views/RecordDetailView.paramRuntimeParity-6431.test.tsx index 8e94fb56e4..f140531e69 100644 --- a/packages/app-shell/src/views/RecordDetailView.paramRuntimeParity-6431.test.tsx +++ b/packages/app-shell/src/views/RecordDetailView.paramRuntimeParity-6431.test.tsx @@ -80,6 +80,9 @@ import * as React from 'react'; import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; +// Module scope as well as where a test awaits it below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@object-ui/components'; import { render, screen, waitFor, act, cleanup, fireEvent } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; diff --git a/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx b/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx index 9257160a41..5a9b8289e6 100644 --- a/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx +++ b/packages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsx @@ -67,6 +67,9 @@ import path from 'node:path'; import { readFileSync } from 'node:fs'; import { fileURLToPath } from 'node:url'; import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; +// Module scope as well as where a test awaits it below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@object-ui/components'; import { render, screen, act, cleanup, fireEvent } from '@testing-library/react'; vi.mock('@object-ui/auth', async (importOriginal) => ({ diff --git a/packages/app-shell/src/views/metadata-admin/ResourceEditPage.requiredInGatedSection-6900.test.tsx b/packages/app-shell/src/views/metadata-admin/ResourceEditPage.requiredInGatedSection-6900.test.tsx index c2dc5ed2c6..78e64f3f04 100644 --- a/packages/app-shell/src/views/metadata-admin/ResourceEditPage.requiredInGatedSection-6900.test.tsx +++ b/packages/app-shell/src/views/metadata-admin/ResourceEditPage.requiredInGatedSection-6900.test.tsx @@ -38,6 +38,9 @@ import '@testing-library/jest-dom/vitest'; import * as React from 'react'; import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest'; +// Module scope as well as where a test awaits it below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@objectstack/formula'; import { render, screen, fireEvent, cleanup, waitFor, act } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; diff --git a/packages/app-shell/src/views/metadata-admin/clientValidation.optOuts.test.ts b/packages/app-shell/src/views/metadata-admin/clientValidation.optOuts.test.ts index a293e1e84b..2e0d8f5877 100644 --- a/packages/app-shell/src/views/metadata-admin/clientValidation.optOuts.test.ts +++ b/packages/app-shell/src/views/metadata-admin/clientValidation.optOuts.test.ts @@ -36,6 +36,13 @@ */ import { describe, it, expect } from 'vitest'; +// Module scope as well as where a test awaits it below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@objectstack/spec'; +import '@objectstack/spec/integration'; +import '@objectstack/spec/kernel'; +import '@objectstack/spec/security'; +import '@objectstack/spec/system'; import { arrayElementSchema } from '@object-ui/test-support'; import { validateMetadataDraft, hasClientValidator } from './clientValidation'; diff --git a/packages/app-shell/src/views/metadata-admin/clientValidation.retiredFormulaKey.test.ts b/packages/app-shell/src/views/metadata-admin/clientValidation.retiredFormulaKey.test.ts index f1db674fcb..2d1819828a 100644 --- a/packages/app-shell/src/views/metadata-admin/clientValidation.retiredFormulaKey.test.ts +++ b/packages/app-shell/src/views/metadata-admin/clientValidation.retiredFormulaKey.test.ts @@ -18,6 +18,9 @@ */ import { describe, it, expect } from 'vitest'; +// Module scope as well as where a test awaits it below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@objectstack/spec/data'; import { validateMetadataDraft } from './clientValidation'; const draftWith = (fields: unknown) => ({ name: 'invoice', label: 'Invoice', fields }); diff --git a/packages/app-shell/src/views/metadata-admin/inspectors/ViewVariantInspector.requiredInGatedSection-6900.test.tsx b/packages/app-shell/src/views/metadata-admin/inspectors/ViewVariantInspector.requiredInGatedSection-6900.test.tsx index eeb61ec717..2558f022e9 100644 --- a/packages/app-shell/src/views/metadata-admin/inspectors/ViewVariantInspector.requiredInGatedSection-6900.test.tsx +++ b/packages/app-shell/src/views/metadata-admin/inspectors/ViewVariantInspector.requiredInGatedSection-6900.test.tsx @@ -27,6 +27,9 @@ import '@testing-library/jest-dom/vitest'; import * as React from 'react'; import { describe, it, expect, vi, afterEach, beforeEach } from 'vitest'; +// Module scope as well as where a test awaits it below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@objectstack/formula'; import { render, screen, cleanup, waitFor, act } from '@testing-library/react'; const cel = (source: string) => ({ dialect: 'cel', source }); diff --git a/packages/app-shell/src/views/studio-design/DataPillar.addFieldPopover-12516.test.tsx b/packages/app-shell/src/views/studio-design/DataPillar.addFieldPopover-12516.test.tsx index 42ba09d3ba..d57bb84094 100644 --- a/packages/app-shell/src/views/studio-design/DataPillar.addFieldPopover-12516.test.tsx +++ b/packages/app-shell/src/views/studio-design/DataPillar.addFieldPopover-12516.test.tsx @@ -14,6 +14,9 @@ import '@testing-library/jest-dom/vitest'; import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'; +// Module scope as well as in the `vi.mock` factory below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@object-ui/components'; import { cleanup, render, screen, waitFor, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { MemoryRouter } from 'react-router-dom'; diff --git a/packages/app-shell/src/views/studio-design/DataPillar.formToolbar-12451.test.tsx b/packages/app-shell/src/views/studio-design/DataPillar.formToolbar-12451.test.tsx index 972bb4d131..5bee7855f1 100644 --- a/packages/app-shell/src/views/studio-design/DataPillar.formToolbar-12451.test.tsx +++ b/packages/app-shell/src/views/studio-design/DataPillar.formToolbar-12451.test.tsx @@ -18,6 +18,9 @@ import '@testing-library/jest-dom/vitest'; import { afterEach, describe, expect, it, vi } from 'vitest'; +// Module scope as well as in the `vi.mock` factory below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@object-ui/components'; import { cleanup, render, screen, waitFor, within } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { MemoryRouter } from 'react-router-dom'; diff --git a/packages/app-shell/src/views/studio-design/DataPillar.gridProjection.test.tsx b/packages/app-shell/src/views/studio-design/DataPillar.gridProjection.test.tsx index 42f81781a5..04e3ae1d14 100644 --- a/packages/app-shell/src/views/studio-design/DataPillar.gridProjection.test.tsx +++ b/packages/app-shell/src/views/studio-design/DataPillar.gridProjection.test.tsx @@ -26,6 +26,9 @@ import '@testing-library/jest-dom/vitest'; import * as React from 'react'; import { describe, it, expect, vi, afterEach } from 'vitest'; +// Module scope as well as in the `vi.mock` factory below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@object-ui/components'; import { render, screen, cleanup, waitFor } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; diff --git a/packages/app-shell/src/views/studio-design/DataPillar.picklistServedOptions-10202.test.tsx b/packages/app-shell/src/views/studio-design/DataPillar.picklistServedOptions-10202.test.tsx index 1ad2143821..8d1b866294 100644 --- a/packages/app-shell/src/views/studio-design/DataPillar.picklistServedOptions-10202.test.tsx +++ b/packages/app-shell/src/views/studio-design/DataPillar.picklistServedOptions-10202.test.tsx @@ -20,6 +20,9 @@ import '@testing-library/jest-dom/vitest'; import * as React from 'react'; import { afterEach, describe, expect, it, vi } from 'vitest'; +// Module scope as well as in the `vi.mock` factory below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@object-ui/components'; import { act, cleanup, fireEvent, render, screen, waitFor } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; import { MetadataClient } from '@object-ui/data-objectstack'; diff --git a/packages/app-shell/src/views/studio-design/StudioDesignSurface.autosaveInFlight-11204.test.tsx b/packages/app-shell/src/views/studio-design/StudioDesignSurface.autosaveInFlight-11204.test.tsx index 2ed7fcb4ab..36c6777eff 100644 --- a/packages/app-shell/src/views/studio-design/StudioDesignSurface.autosaveInFlight-11204.test.tsx +++ b/packages/app-shell/src/views/studio-design/StudioDesignSurface.autosaveInFlight-11204.test.tsx @@ -35,6 +35,9 @@ import '@testing-library/jest-dom/vitest'; import * as React from 'react'; import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; +// Module scope as well as in the `vi.mock` factory below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@object-ui/components'; import { render, screen, fireEvent, cleanup, waitFor, within, act } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; diff --git a/packages/app-shell/src/views/studio-design/StudioDesignSurface.autosaveSwitch-11232.test.tsx b/packages/app-shell/src/views/studio-design/StudioDesignSurface.autosaveSwitch-11232.test.tsx index 36e568faa8..76a1f7c252 100644 --- a/packages/app-shell/src/views/studio-design/StudioDesignSurface.autosaveSwitch-11232.test.tsx +++ b/packages/app-shell/src/views/studio-design/StudioDesignSurface.autosaveSwitch-11232.test.tsx @@ -37,6 +37,9 @@ import '@testing-library/jest-dom/vitest'; import * as React from 'react'; import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; +// Module scope as well as in the `vi.mock` factory below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@object-ui/components'; import { render, screen, fireEvent, cleanup, waitFor, within, act } from '@testing-library/react'; import { MemoryRouter, Route, Routes } from 'react-router-dom'; diff --git a/packages/app-shell/src/views/studio-design/StudioDesignSurface.draftVersionConflict-11773.test.tsx b/packages/app-shell/src/views/studio-design/StudioDesignSurface.draftVersionConflict-11773.test.tsx index 72b807f4b7..ebcf142cd6 100644 --- a/packages/app-shell/src/views/studio-design/StudioDesignSurface.draftVersionConflict-11773.test.tsx +++ b/packages/app-shell/src/views/studio-design/StudioDesignSurface.draftVersionConflict-11773.test.tsx @@ -31,6 +31,9 @@ import '@testing-library/jest-dom/vitest'; import * as React from 'react'; import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'; +// Module scope as well as in the `vi.mock` factory below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@object-ui/components'; import { render, screen, fireEvent, cleanup, waitFor, within, act } from '@testing-library/react'; import { MemoryRouter } from 'react-router-dom'; import { MetadataClient, type MetadataError } from '@object-ui/data-objectstack'; diff --git a/packages/auth/src/__tests__/auth-spec-parity.test.ts b/packages/auth/src/__tests__/auth-spec-parity.test.ts index e6d005a0a3..45d0b896e8 100644 --- a/packages/auth/src/__tests__/auth-spec-parity.test.ts +++ b/packages/auth/src/__tests__/auth-spec-parity.test.ts @@ -28,6 +28,9 @@ */ import { describe, it, expect } from 'vitest'; +// Module scope as well as where a test awaits it below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@objectstack/spec/api'; import ts from 'typescript'; import { createRequire } from 'node:module'; import { readFileSync } from 'node:fs'; diff --git a/packages/plugin-calendar/src/__tests__/ObjectCalendar.dataObjectArmRefused-8348.test.tsx b/packages/plugin-calendar/src/__tests__/ObjectCalendar.dataObjectArmRefused-8348.test.tsx index b4972c095c..1781738a29 100644 --- a/packages/plugin-calendar/src/__tests__/ObjectCalendar.dataObjectArmRefused-8348.test.tsx +++ b/packages/plugin-calendar/src/__tests__/ObjectCalendar.dataObjectArmRefused-8348.test.tsx @@ -60,6 +60,9 @@ import React from 'react'; import { describe, it, expect, vi, afterEach } from 'vitest'; +// Module scope as well as where a test awaits it below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@objectstack/spec/ui'; import { render, screen, waitFor, cleanup } from '@testing-library/react'; // The month grid is orthogonal to what this file observes (which records became diff --git a/packages/plugin-dashboard/src/__tests__/ObjectMetricWidget.i18nLabel.test.tsx b/packages/plugin-dashboard/src/__tests__/ObjectMetricWidget.i18nLabel.test.tsx index e8a718386e..3645258017 100644 --- a/packages/plugin-dashboard/src/__tests__/ObjectMetricWidget.i18nLabel.test.tsx +++ b/packages/plugin-dashboard/src/__tests__/ObjectMetricWidget.i18nLabel.test.tsx @@ -77,6 +77,9 @@ import * as React from 'react'; import { describe, it, expect, vi, afterEach } from 'vitest'; +// Module scope as well as where a test awaits it below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@objectstack/spec/ui'; import { render, screen, fireEvent, cleanup } from '@testing-library/react'; import { I18nProvider } from '@object-ui/i18n'; // Imported from the package barrel at MODULE scope: the drill drawer renders diff --git a/packages/plugin-grid/src/__tests__/gridBareArrayDataRefused-8348.test.tsx b/packages/plugin-grid/src/__tests__/gridBareArrayDataRefused-8348.test.tsx index 565e9ff933..87c362427b 100644 --- a/packages/plugin-grid/src/__tests__/gridBareArrayDataRefused-8348.test.tsx +++ b/packages/plugin-grid/src/__tests__/gridBareArrayDataRefused-8348.test.tsx @@ -76,6 +76,9 @@ */ import { describe, it, expect, vi } from 'vitest'; +// Module scope as well as where a test awaits it below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@objectstack/spec/ui'; import { render, screen, waitFor } from '@testing-library/react'; import React from 'react'; import { SchemaRenderer, SchemaRendererProvider } from '@object-ui/react'; diff --git a/packages/react/src/__tests__/SchemaRenderer.concealmentGateFaultDiagnostic.test.tsx b/packages/react/src/__tests__/SchemaRenderer.concealmentGateFaultDiagnostic.test.tsx index aaf7b58854..125d5e361c 100644 --- a/packages/react/src/__tests__/SchemaRenderer.concealmentGateFaultDiagnostic.test.tsx +++ b/packages/react/src/__tests__/SchemaRenderer.concealmentGateFaultDiagnostic.test.tsx @@ -90,6 +90,10 @@ */ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; +// Module scope as well as after each `vi.resetModules()` below: the cold transform is +// paid once during collection, and every re-import after a reset re-evaluates the cached +// transform instead of compiling inside a clocked window (AGENTS.md, flaky-test discipline). +import '@object-ui/core'; import { render, screen, cleanup } from '@testing-library/react'; import React from 'react'; import { diff --git a/packages/react/src/__tests__/SchemaRenderer.disabledGateFaultDiagnostic.test.tsx b/packages/react/src/__tests__/SchemaRenderer.disabledGateFaultDiagnostic.test.tsx index c0a0c3d828..38226507b8 100644 --- a/packages/react/src/__tests__/SchemaRenderer.disabledGateFaultDiagnostic.test.tsx +++ b/packages/react/src/__tests__/SchemaRenderer.disabledGateFaultDiagnostic.test.tsx @@ -61,6 +61,10 @@ */ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; +// Module scope as well as after each `vi.resetModules()` below: the cold transform is +// paid once during collection, and every re-import after a reset re-evaluates the cached +// transform instead of compiling inside a clocked window (AGENTS.md, flaky-test discipline). +import '@object-ui/core'; import { render, screen, cleanup } from '@testing-library/react'; import React from 'react'; import { diff --git a/packages/react/src/__tests__/SchemaRenderer.productionPredicateFaultWarning.test.tsx b/packages/react/src/__tests__/SchemaRenderer.productionPredicateFaultWarning.test.tsx index e9d1ae34d3..e183f03cb7 100644 --- a/packages/react/src/__tests__/SchemaRenderer.productionPredicateFaultWarning.test.tsx +++ b/packages/react/src/__tests__/SchemaRenderer.productionPredicateFaultWarning.test.tsx @@ -69,6 +69,10 @@ */ import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest'; +// Module scope as well as after each `vi.resetModules()` below: the cold transform is +// paid once during collection, and every re-import after a reset re-evaluates the cached +// transform instead of compiling inside a clocked window (AGENTS.md, flaky-test discipline). +import '@object-ui/core'; import { render, screen, cleanup } from '@testing-library/react'; import React from 'react'; import { UNRESOLVABLE_VISIBILITY_PREFIX } from '../utils/visibilityDiagnostic'; diff --git a/packages/types/src/__tests__/registry-meta-carry-9102.test.ts b/packages/types/src/__tests__/registry-meta-carry-9102.test.ts index 35a79894d2..aaa23c3e0e 100644 --- a/packages/types/src/__tests__/registry-meta-carry-9102.test.ts +++ b/packages/types/src/__tests__/registry-meta-carry-9102.test.ts @@ -49,6 +49,9 @@ */ import { describe, it, expect } from 'vitest'; +// Module scope as well as where a test awaits it below: the cold transform is paid +// during collection, which no test or hook timeout clocks (AGENTS.md, flaky-test discipline). +import '@objectstack/spec/data'; import { z } from 'zod'; import { readdirSync, readFileSync } from 'node:fs'; import { dirname, join } from 'node:path';