Skip to content

Commit c9df758

Browse files
committed
test(rest): pay the spec subpath loads at module scope in the door suite
`pnpm check:test-source-alias` reds on a `@objectstack/spec/*` dynamic import first paid inside a clocked window: this package resolves both specifiers through `dist/`, so the first call transforms that graph while a testTimeout runs. Side-effect imports at module top move the transform into collection, which vitest clocks against nothing. The dynamic calls are unchanged. Claude-Session: https://claude.ai/code/session_01DapQyvYrFb1MxSYe7BL2nt Co-authored-by: Claude <noreply@anthropic.com>
1 parent c8026f6 commit c9df758

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎packages/rest/src/analytics-dataset-selection-door.test.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919
* A door that refuses too much is a worse defect than the one being fixed.
2020
*/
2121

22+
// The dynamic `import()`s below are paid HERE, at module scope, so the
23+
// transform lands during collection rather than inside a clocked window
24+
// (`pnpm check:test-source-alias`; this package resolves both specifiers
25+
// through `dist/`). The dynamic calls stay where they are — this only decides
26+
// where the first load is paid.
27+
import '@objectstack/spec/api';
28+
import '@objectstack/spec/data';
29+
2230
import { describe, it, expect, vi } from 'vitest';
2331
import { RestServer } from './rest-server';
2432
import {

0 commit comments

Comments
 (0)