Skip to content
This repository was archived by the owner on Oct 26, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .changeset/25763-warm-test-imports.md
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
3 changes: 3 additions & 0 deletions packages/app-shell/src/__tests__/spec-symbol-parity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
3 changes: 3 additions & 0 deletions packages/auth/src/__tests__/auth-spec-parity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
3 changes: 3 additions & 0 deletions packages/types/src/__tests__/registry-meta-carry-9102.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Loading