@vmz/test 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -11
- package/dist/browser.d.ts +1 -2
- package/dist/browser.js +1 -2
- package/dist/compile.d.ts +1 -1
- package/dist/compile.js +2 -2
- package/dist/deployment.d.ts +1 -1
- package/dist/deployment.js +1 -1
- package/dist/discover.d.ts +1 -1
- package/dist/discover.js +1 -1
- package/dist/logic.d.ts +0 -1
- package/dist/logic.js +0 -1
- package/dist/protocol.d.ts +2 -3
- package/dist/protocol.js +2 -3
- package/dist/resume.d.ts +1 -1
- package/dist/resume.js +2 -2
- package/dist/ssr.d.ts +1 -1
- package/dist/ssr.js +1 -1
- package/package.json +3 -4
- package/src/browser.ts +0 -602
- package/src/compile.ts +0 -509
- package/src/deployment.ts +0 -204
- package/src/discover.ts +0 -74
- package/src/index.ts +0 -37
- package/src/logic.ts +0 -427
- package/src/protocol.ts +0 -128
- package/src/resume.ts +0 -275
- package/src/run.ts +0 -124
- package/src/ssr.ts +0 -265
package/README.md
CHANGED
|
@@ -26,24 +26,29 @@ safe server boundaries, SSR that does not needlessly replay, and application beh
|
|
|
26
26
|
|
|
27
27
|
## One scenario, several kinds of evidence
|
|
28
28
|
|
|
29
|
-
| Surface
|
|
30
|
-
|
|
31
|
-
| Compile
|
|
32
|
-
| Logic
|
|
33
|
-
| Browser
|
|
34
|
-
| Router
|
|
35
|
-
| SSR / Resume | HTML, serialized state, event entries, and replay avoidance
|
|
36
|
-
| Deployment
|
|
29
|
+
| Surface | Evidence VMZ can collect |
|
|
30
|
+
|--------------|--------------------------------------------------------------------|
|
|
31
|
+
| Compile | Diagnostics, graph identities, and generated boundaries |
|
|
32
|
+
| Logic | State transitions, derived work, and cancellation |
|
|
33
|
+
| Browser | Real input, semantic locators, DOM, accessibility, and screenshots |
|
|
34
|
+
| Router | Matched RouteId, layout retention, loading, errors, and disposal |
|
|
35
|
+
| SSR / Resume | HTML, serialized state, event entries, and replay avoidance |
|
|
36
|
+
| Deployment | Client/server reachability, capabilities, artifacts, and traces |
|
|
37
37
|
|
|
38
38
|
### UI automation without a borrowed worldview
|
|
39
39
|
|
|
40
|
-
VMZ can use a real browser protocol as transport while owning locator, action, waiting, and expectation semantics. Tests
|
|
40
|
+
VMZ can use a real browser protocol as transport while owning locator, action, waiting, and expectation semantics. Tests
|
|
41
|
+
can find elements by role, label, text, RouteId, or stable test identity; CSS remains an escape hatch rather than the
|
|
42
|
+
default contract.
|
|
41
43
|
|
|
42
|
-
Auto-waiting can observe navigation, pending work, region commits, and server activity instead of guessing with
|
|
44
|
+
Auto-waiting can observe navigation, pending work, region commits, and server activity instead of guessing with
|
|
45
|
+
arbitrary delays. A failure can connect the visible symptom to the application work that produced it.
|
|
43
46
|
|
|
44
47
|
### Precision is testable
|
|
45
48
|
|
|
46
|
-
A fine-grained compiler should prove that nothing unrelated ran. VMZ tests can check that the intended binding changed,
|
|
49
|
+
A fine-grained compiler should prove that nothing unrelated ran. VMZ tests can check that the intended binding changed,
|
|
50
|
+
unrelated computations stayed idle, an obsolete generation was cancelled, and a disposed owner received no late write.
|
|
51
|
+
That turns testing into a competitive feature rather than a bundled convenience.
|
|
47
52
|
|
|
48
53
|
## License
|
|
49
54
|
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Browser Host for `vmz test --mode browser` (
|
|
2
|
+
* Browser Host for `vmz test --mode browser` ( close slice).
|
|
3
3
|
*
|
|
4
4
|
* Real Chromium/Chrome via CDP. Transport may use puppeteer-core as a CDP
|
|
5
5
|
* client — that is NOT the Playwright/Puppeteer *test model*. Manifest actions
|
|
6
6
|
* and assertions remain the VMZ Browser Host protocol; same Direct schedule as
|
|
7
7
|
* production (`__vmzCreate` in a real document).
|
|
8
8
|
*
|
|
9
|
-
* Design: 规划设计/vmz/16 §T2 · §5 浏览器连接
|
|
10
9
|
*/
|
|
11
10
|
type Diag = {
|
|
12
11
|
severity: string;
|
package/dist/browser.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Browser Host for `vmz test --mode browser` (
|
|
2
|
+
* Browser Host for `vmz test --mode browser` ( close slice).
|
|
3
3
|
*
|
|
4
4
|
* Real Chromium/Chrome via CDP. Transport may use puppeteer-core as a CDP
|
|
5
5
|
* client — that is NOT the Playwright/Puppeteer *test model*. Manifest actions
|
|
6
6
|
* and assertions remain the VMZ Browser Host protocol; same Direct schedule as
|
|
7
7
|
* production (`__vmzCreate` in a real document).
|
|
8
8
|
*
|
|
9
|
-
* Design: 规划设计/vmz/16 §T2 · §5 浏览器连接
|
|
10
9
|
*/
|
|
11
10
|
import { spawn } from 'node:child_process';
|
|
12
11
|
import fs from 'node:fs';
|
package/dist/compile.d.ts
CHANGED
package/dist/compile.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Compile-mode host for `vmz test` / `@vmz/test` (
|
|
2
|
+
* Compile-mode host for `vmz test` / `@vmz/test` (+).
|
|
3
3
|
* Builds the project and checks graph/plan/view assertions against dist artifacts.
|
|
4
4
|
*/
|
|
5
5
|
import fs from 'node:fs';
|
|
@@ -256,7 +256,7 @@ export function runCompileManifest(manifest, ctx) {
|
|
|
256
256
|
}
|
|
257
257
|
if (expect.noRender === true || expect.noRenderFallback === true) {
|
|
258
258
|
if (clientJs.includes('prototype.render')) {
|
|
259
|
-
fail('production client must not emit prototype.render (
|
|
259
|
+
fail('production client must not emit prototype.render (production Direct emit)');
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
if (typeof expect.includes === 'string' && !clientJs.includes(expect.includes)) {
|
package/dist/deployment.d.ts
CHANGED
package/dist/deployment.js
CHANGED
package/dist/discover.d.ts
CHANGED
package/dist/discover.js
CHANGED
package/dist/logic.d.ts
CHANGED
package/dist/logic.js
CHANGED
package/dist/protocol.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* VMZ native test protocol
|
|
2
|
+
* VMZ native test protocol — validators + report builders.
|
|
3
3
|
* Schema ids live in `@vmz/protocol` (mirrors Rust `vmz-protocol`).
|
|
4
|
-
* Design: 规划设计/vmz/16 — not a Test IR; references Program Graph + Execution Plan.
|
|
5
4
|
*/
|
|
6
5
|
export { EXECUTION_PLAN_REF_SCHEMA, PLAN_SCHEMA, TEST_ACTION_SCHEMA, TEST_ASSERTION_SCHEMA, TEST_MANIFEST_SCHEMA, TEST_PROTOCOL, TEST_REPORT_SCHEMA, testCatalog, } from '@vmz/protocol';
|
|
7
6
|
export type TestMode = 'compile' | 'logic' | 'browser' | 'ssr' | 'resume' | 'deployment' | 'all';
|
|
@@ -16,7 +15,7 @@ export type ManifestValidation = {
|
|
|
16
15
|
ok: false;
|
|
17
16
|
error: string;
|
|
18
17
|
};
|
|
19
|
-
/** Validate a discovered manifest object (narrow
|
|
18
|
+
/** Validate a discovered manifest object (narrow checks). */
|
|
20
19
|
export declare function validateManifest(raw: unknown, file: string): ManifestValidation;
|
|
21
20
|
export type TestReportEntryInput = {
|
|
22
21
|
testId: string;
|
package/dist/protocol.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* VMZ native test protocol
|
|
2
|
+
* VMZ native test protocol — validators + report builders.
|
|
3
3
|
* Schema ids live in `@vmz/protocol` (mirrors Rust `vmz-protocol`).
|
|
4
|
-
* Design: 规划设计/vmz/16 — not a Test IR; references Program Graph + Execution Plan.
|
|
5
4
|
*/
|
|
6
5
|
import { EXECUTION_PLAN_REF_SCHEMA, PLAN_SCHEMA, TEST_MANIFEST_SCHEMA, TEST_REPORT_SCHEMA } from '@vmz/protocol';
|
|
7
6
|
export { EXECUTION_PLAN_REF_SCHEMA, PLAN_SCHEMA, TEST_ACTION_SCHEMA, TEST_ASSERTION_SCHEMA, TEST_MANIFEST_SCHEMA, TEST_PROTOCOL, TEST_REPORT_SCHEMA, testCatalog, } from '@vmz/protocol';
|
|
@@ -26,7 +25,7 @@ export function parseModes(raw) {
|
|
|
26
25
|
}
|
|
27
26
|
return parts;
|
|
28
27
|
}
|
|
29
|
-
/** Validate a discovered manifest object (narrow
|
|
28
|
+
/** Validate a discovered manifest object (narrow checks). */
|
|
30
29
|
export function validateManifest(raw, file) {
|
|
31
30
|
if (!raw || typeof raw !== 'object') {
|
|
32
31
|
return { ok: false, error: `${file}: manifest must be an object` };
|
package/dist/resume.d.ts
CHANGED
package/dist/resume.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Resume host for `vmz test --mode resume` (
|
|
2
|
+
* Resume host for `vmz test --mode resume` (/ first slice).
|
|
3
3
|
* SSR shell → resume adopt → event patch; onMount must not run.
|
|
4
4
|
*/
|
|
5
5
|
import path from 'node:path';
|
|
@@ -138,7 +138,7 @@ export async function runResumeManifest(manifest, ctx) {
|
|
|
138
138
|
}
|
|
139
139
|
island = el;
|
|
140
140
|
el.click();
|
|
141
|
-
// EventEntry resume is async via Promise.resolve(fn
|
|
141
|
+
// EventEntry resume is async via Promise.resolve(fn).
|
|
142
142
|
await Promise.resolve();
|
|
143
143
|
await Promise.resolve();
|
|
144
144
|
await new Promise((r) => setTimeout(r, Number(a.waitMs ?? 10)));
|
package/dist/ssr.d.ts
CHANGED
package/dist/ssr.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vmz/test",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "VMZ native test protocol + Compile/Logic/Browser/SSR/Resume/Deployment hosts",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -21,15 +21,14 @@
|
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"dist",
|
|
24
|
-
"src",
|
|
25
24
|
"README.md"
|
|
26
25
|
],
|
|
27
26
|
"scripts": {
|
|
28
27
|
"build": "tsc -p tsconfig.json"
|
|
29
28
|
},
|
|
30
29
|
"dependencies": {
|
|
31
|
-
"@vmz/core": "0.0.
|
|
32
|
-
"@vmz/protocol": "0.0.
|
|
30
|
+
"@vmz/core": "0.0.3",
|
|
31
|
+
"@vmz/protocol": "0.0.3",
|
|
33
32
|
"linkedom": "^0.18.13",
|
|
34
33
|
"puppeteer-core": "^24.11.2"
|
|
35
34
|
},
|