Skip to content

Commit bfa3609

Browse files
committed
test(plugin-security): load the wrapped formula matcher at module top
check:test-source-alias: a dependency resolved through dist/ is loaded at collection, never inside a clocked test body. Claude-Session: https://claude.ai/code/session_01DiCSbmJrkzNhuEAier4VoJ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1d9ccec commit bfa3609

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎packages/plugins/plugin-security/src/rls-check-stored-form.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
*/
3232

3333
import { describe, it, expect, afterEach, vi } from 'vitest';
34+
// The mocked module (see `vi.mock` below), loaded at module top.
35+
import { matchesFilterCondition } from '@objectstack/formula';
3436
import { ObjectQL } from '@objectstack/objectql';
3537
import { SqlDriver } from '@objectstack/driver-sql';
3638
import { SqliteWasmDriver } from '@objectstack/driver-sqlite-wasm';
@@ -200,8 +202,7 @@ const CELLS: Cell[] = [
200202
];
201203

202204
describe("formula's whole-day copy is out of reach in this file", () => {
203-
it('a bare-day $lte no longer admits an instant later on that day', async () => {
204-
const { matchesFilterCondition } = await import('@objectstack/formula');
205+
it('a bare-day $lte no longer admits an instant later on that day', () => {
205206
expect(matchesFilterCondition({ d: '2026-01-05T15:00:00Z' }, { d: { $lte: '2026-01-05' } } as never)).toBe(false);
206207
expect(matchesFilterCondition({ d: '2026-01-05' }, { d: { $lte: '2026-01-05' } } as never)).toBe(true);
207208
});

0 commit comments

Comments
 (0)