Move core-v2 tests into packages/core-v2/tests
Tests no longer sit next to the implementation. They import the package through ../src, the root tsconfig still type-checks them, and the package build and declarations cover only src/. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Faarh2Ts6StJPcz2mRiHiR
This commit is contained in:
@@ -308,6 +308,10 @@ Each module depends only on the ones listed above it.
|
||||
| `gesture/recognizer.ts` | Pointer-down admission, `DirectionalTracker`, `GestureRecognizer`, and `useOriginGesture` |
|
||||
| `components/` | `OriginScene`, `OriginGesture`, `OriginGestureSurface`, and the internal node host |
|
||||
|
||||
Tests live in `tests/`, outside `src/`. `tests/property.test.ts` checks the
|
||||
scene's structural invariants after every step of random operation sequences
|
||||
and pointer streams; set `PROPERTY_SEEDS` to run more than the default 60.
|
||||
|
||||
Pure helpers used by a class (for example `matchesStart`, `stepSpring`, or
|
||||
`composeNodeStyle`) are module-level `export const`s that the class calls, so
|
||||
they can be tested directly without widening the class's interface.
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
useOriginGesture,
|
||||
type OriginGestureBinding,
|
||||
type OriginGestureCompletionContext,
|
||||
} from ".";
|
||||
} from "../src";
|
||||
|
||||
const mountedApps: Array<ReturnType<typeof createApp>> = [];
|
||||
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
originView,
|
||||
useOriginGesture,
|
||||
type OriginGestureDefinition,
|
||||
} from ".";
|
||||
} from "../src";
|
||||
|
||||
const apps: Array<ReturnType<typeof createApp>> = [];
|
||||
afterEach(() => {
|
||||
@@ -23,9 +23,9 @@ import {
|
||||
under,
|
||||
type OriginAction,
|
||||
type OriginOperationHandle,
|
||||
} from ".";
|
||||
import type { SceneGraph } from "./scene/graph";
|
||||
import type { OriginScene as Scene } from "./scene/types";
|
||||
} from "../src";
|
||||
import type { SceneGraph } from "../src/scene/graph";
|
||||
import type { OriginScene as Scene } from "../src/scene/types";
|
||||
|
||||
const SEEDS = Number(process.env.PROPERTY_SEEDS ?? 60);
|
||||
|
||||
@@ -19,8 +19,8 @@ import {
|
||||
OriginSceneError,
|
||||
originView,
|
||||
type OriginGestureDefinition,
|
||||
} from ".";
|
||||
import { shouldCommit } from "./scene/graph";
|
||||
} from "../src";
|
||||
import { shouldCommit } from "../src/scene/graph";
|
||||
|
||||
const apps: Array<ReturnType<typeof createApp>> = [];
|
||||
afterEach(() => {
|
||||
@@ -18,7 +18,7 @@ import {
|
||||
originView,
|
||||
replace,
|
||||
under,
|
||||
} from ".";
|
||||
} from "../src";
|
||||
|
||||
const mountedApps: Array<ReturnType<typeof createApp>> = [];
|
||||
|
||||
@@ -9,6 +9,5 @@
|
||||
"outDir": "dist",
|
||||
"tsBuildInfoFile": "../../node_modules/.tmp/core-v2.tsbuildinfo"
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.vue"],
|
||||
"exclude": ["src/**/*.test.ts"]
|
||||
"include": ["src/**/*.ts", "src/**/*.vue"]
|
||||
}
|
||||
|
||||
@@ -15,6 +15,6 @@ ONLY=rewrite npx vitest bench --run --config packages/core-v2/verify/vitest.conf
|
||||
Run each implementation in its own process with `ONLY=`; running both in one
|
||||
process biases whichever runs second.
|
||||
|
||||
Behavioural verification lives with the unit tests: `src/property.test.ts`
|
||||
Behavioural verification lives with the unit tests: `tests/property.test.ts`
|
||||
drives random operation sequences and pointer streams and checks the scene's
|
||||
structural invariants after every step. Set `PROPERTY_SEEDS` to run more.
|
||||
|
||||
+2
-1
@@ -24,6 +24,7 @@
|
||||
"apps/demo/src/**/*.ts",
|
||||
"apps/demo/src/**/*.vue",
|
||||
"packages/*/src/**/*.ts",
|
||||
"packages/*/src/**/*.vue"
|
||||
"packages/*/src/**/*.vue",
|
||||
"packages/*/tests/**/*.ts"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user