@solidnative-dev/testing 0.0.0-stage → 0.1.0-alpha.0
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/LICENSE +21 -0
- package/README.md +258 -2
- package/dist/diagnostics.d.ts +103 -0
- package/dist/diagnostics.d.ts.map +1 -0
- package/dist/diagnostics.js +392 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/index.d.ts +303 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1682 -0
- package/dist/index.js.map +1 -0
- package/dist/loader.d.ts +17 -0
- package/dist/loader.d.ts.map +1 -0
- package/dist/loader.js +42 -0
- package/dist/loader.js.map +1 -0
- package/dist/register.d.ts +2 -0
- package/dist/register.d.ts.map +1 -0
- package/dist/register.js +10 -0
- package/dist/register.js.map +1 -0
- package/package.json +66 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Solid Native contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,259 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@solidnative-dev/testing`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The package supplies a deterministic application test renderer over a strict
|
|
4
|
+
in-memory implementation of `NativeHost`. It renders ordinary Solid Native
|
|
5
|
+
components, records commits, exposes semantic queries, injects native events,
|
|
6
|
+
and verifies exact surface cleanup without a simulator.
|
|
7
|
+
|
|
8
|
+
```tsx
|
|
9
|
+
import { renderNative } from "@solidnative-dev/testing";
|
|
10
|
+
|
|
11
|
+
const screen = await renderNative(() => <App />);
|
|
12
|
+
|
|
13
|
+
await screen.press(screen.getByRole("button", { name: "Increment count" }));
|
|
14
|
+
|
|
15
|
+
screen.getByText("Count: 1");
|
|
16
|
+
console.log(screen.debug());
|
|
17
|
+
await screen.cleanup();
|
|
18
|
+
screen.assertDisposed();
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Fresh applications run TS/TSX tests with the first-party command:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
pnpm test
|
|
25
|
+
# or focus one file
|
|
26
|
+
pnpm exec solid-native test test/counter.test.tsx
|
|
27
|
+
# rerun affected tests, optionally focused by test name
|
|
28
|
+
pnpm exec solid-native test --watch --test-name-pattern "counter"
|
|
29
|
+
# exercise the same non-diagnostic tests against optimized Solid
|
|
30
|
+
pnpm exec solid-native test --production
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The command uses Node's built-in test runner and the same shared Solid
|
|
34
|
+
universal OXC compiler as Metro. It selects Solid's development runtime by
|
|
35
|
+
default so official diagnostics and attribution are available; `--production`
|
|
36
|
+
selects optimized semantics for tests that do not require those development-
|
|
37
|
+
only channels. It does not load Babel, Jest, React's test renderer, Metro, a
|
|
38
|
+
simulator, or a device. Default discovery is confined to
|
|
39
|
+
`*.test` and `*.spec` JavaScript/TypeScript files beneath `test/`; explicit
|
|
40
|
+
inputs must resolve inside the application, and the loader rejects oversized
|
|
41
|
+
modules. Node releases with synchronous module hooks use them directly, while
|
|
42
|
+
the minimum supported Node 22 release uses its worker-based registration API.
|
|
43
|
+
Watch mode follows the test files and their imported dependency graph; the
|
|
44
|
+
test-name filter is validated as a bounded JavaScript regular expression before
|
|
45
|
+
the child runner starts.
|
|
46
|
+
|
|
47
|
+
`renderNative` installs the core component descriptors by default and flushes
|
|
48
|
+
the initial commit before returning. It deliberately disables background
|
|
49
|
+
auto-commit scheduling: `flush()`, `act()`, `fireEvent()`, and `press()` are
|
|
50
|
+
explicit deterministic boundaries. Queries always inspect the latest immutable
|
|
51
|
+
host snapshot:
|
|
52
|
+
|
|
53
|
+
- `getByText`, `queryByText`, and `queryAllByText`
|
|
54
|
+
- `getByRole`, including an optional accessible name
|
|
55
|
+
- `getByLabelText`, `getByTestId`, and `getByComponent`
|
|
56
|
+
- `findByText`, `findByRole`, `findByLabelText`, `findByTestId`, and
|
|
57
|
+
`findByComponent` for delayed output
|
|
58
|
+
|
|
59
|
+
Use `screen.within(element)` to scope that complete synchronous and asynchronous
|
|
60
|
+
query set to one currently mounted native subtree. The scope includes its root,
|
|
61
|
+
which is useful for a screen-level test ID. It follows the latest immutable
|
|
62
|
+
snapshot and fails on stale or cross-render roots instead of leaking matches
|
|
63
|
+
from retained sibling screens.
|
|
64
|
+
|
|
65
|
+
The singular `getBy` and `queryBy` forms reject ambiguous matches with a bounded
|
|
66
|
+
summary of the mounted native elements. Event targets carry their owning host
|
|
67
|
+
and surface identity; a stale, removed, or cross-render target fails instead of
|
|
68
|
+
dispatching to a reused numeric handle. `commits` exposes only the commits made
|
|
69
|
+
since that render began, while the underlying `host` remains available for
|
|
70
|
+
controlled measurements and lower-level assertions.
|
|
71
|
+
|
|
72
|
+
`debug()` returns (and never prints) a readable native tree with node handles,
|
|
73
|
+
semantic accessibility props, subscribed events, and raw text. Output is
|
|
74
|
+
bounded by configurable node and depth limits so it is safe to include in test
|
|
75
|
+
failure messages. Use `debug({ includeProps: true })` when transport props are
|
|
76
|
+
needed; their deterministic JSON is separately clipped to keep diagnostics
|
|
77
|
+
bounded.
|
|
78
|
+
|
|
79
|
+
`debugCommits()` returns the render-scoped native transactions in chronological
|
|
80
|
+
order, including surface, sequence, priority, mutation kinds, and causal
|
|
81
|
+
operation IDs. It keeps the latest bounded commits and mutations. Text, prop,
|
|
82
|
+
and command-argument values require explicit
|
|
83
|
+
`debugCommits({ includeValues: true })`; timeout failures include a value-free
|
|
84
|
+
commit tail automatically.
|
|
85
|
+
|
|
86
|
+
Tests that care about native transaction shape do not need to search the raw
|
|
87
|
+
commit array. Capture the current sequence immediately before an action, then
|
|
88
|
+
use the singular or plural commit/mutation queries:
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
const checkpoint = screen.commitCheckpoint();
|
|
92
|
+
await screen.press(screen.getByRole("button", { name: "Increment" }));
|
|
93
|
+
|
|
94
|
+
screen.getCommit({
|
|
95
|
+
afterSequence: checkpoint,
|
|
96
|
+
priority: "user-blocking",
|
|
97
|
+
mutationTypes: ["update-text"],
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
const update = screen.getMutation({
|
|
101
|
+
type: "update-text",
|
|
102
|
+
afterSequence: checkpoint,
|
|
103
|
+
});
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
`getCommit`/`queryCommit`/`queryAllCommits` match sequence, priority, causal
|
|
107
|
+
operation ID, and the exact ordered mutation-kind list. The corresponding
|
|
108
|
+
mutation methods return the containing commit, the mutation, and its index.
|
|
109
|
+
Their discriminated matchers support component and command names, current or
|
|
110
|
+
historical native elements, parent/child placement, and exact prop-name or
|
|
111
|
+
event-name sets. They intentionally do not match text, prop values, or command
|
|
112
|
+
arguments: assert public UI and behavior for those details. Singular queries
|
|
113
|
+
reject ambiguity, cross-render elements are rejected, and failures append the
|
|
114
|
+
same bounded value-free commit tail as timeout diagnostics.
|
|
115
|
+
|
|
116
|
+
Development tests can capture Solid's official diagnostic/attribution artifact
|
|
117
|
+
and the scenario's exact native transactions together:
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
import {
|
|
121
|
+
assertNativeDiagnosticsBudgetFile,
|
|
122
|
+
captureNativeDiagnostics,
|
|
123
|
+
expectNativeCommitBudget,
|
|
124
|
+
expectNoDiagnostics,
|
|
125
|
+
expectNoWaste,
|
|
126
|
+
parseNativeDiagnosticsBudgetFile,
|
|
127
|
+
} from "@solidnative-dev/testing/diagnostics";
|
|
128
|
+
import { readFile } from "node:fs/promises";
|
|
129
|
+
|
|
130
|
+
const { artifact } = await captureNativeDiagnostics(
|
|
131
|
+
async ({ render }) => {
|
|
132
|
+
const screen = await render(() => <Counter />);
|
|
133
|
+
await screen.press(screen.getByLabelText("Increment"));
|
|
134
|
+
screen.getByText("Count: 1");
|
|
135
|
+
},
|
|
136
|
+
{ scenario: "counter press" },
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
expectNoDiagnostics(artifact.solid);
|
|
140
|
+
expectNoWaste(artifact.solid);
|
|
141
|
+
expectNativeCommitBudget(artifact, {
|
|
142
|
+
maxCommits: 3, // mount, update, owner cleanup
|
|
143
|
+
maxMutations: 16,
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const budgets = parseNativeDiagnosticsBudgetFile(
|
|
147
|
+
await readFile("solid-native.diagnostics.json", "utf8"),
|
|
148
|
+
);
|
|
149
|
+
assertNativeDiagnosticsBudgetFile(artifact, budgets);
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
The checked-in policy extends Solid's upstream format without renaming its
|
|
153
|
+
fields:
|
|
154
|
+
|
|
155
|
+
```json
|
|
156
|
+
{
|
|
157
|
+
"formatVersion": 1,
|
|
158
|
+
"scenarios": {
|
|
159
|
+
"counter press": {
|
|
160
|
+
"maxReruns": 1,
|
|
161
|
+
"maxWastedRuns": 0,
|
|
162
|
+
"scopes": { "/^counter/": 1 },
|
|
163
|
+
"native": {
|
|
164
|
+
"maxCommits": 3,
|
|
165
|
+
"maxMutations": 16,
|
|
166
|
+
"maxCommitsPerRender": 3,
|
|
167
|
+
"maxMutationsPerCommit": 8
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Parsing rejects oversized input, unknown fields, invalid regular expressions,
|
|
175
|
+
duplicate allow-list entries, control characters, and unbounded numeric values,
|
|
176
|
+
then returns a frozen policy. Assertion selects the artifact's exact scenario;
|
|
177
|
+
a missing policy entry fails so a renamed or newly added test cannot silently
|
|
178
|
+
run without reviewed Solid and native budgets.
|
|
179
|
+
|
|
180
|
+
`captureNativeDiagnostics` resolves against the application's exact
|
|
181
|
+
`@solidjs/signals` instance, automatically disposes every render in reverse
|
|
182
|
+
order, and records cleanup before closing capture. Render and commit counts are
|
|
183
|
+
bounded; native summaries retain mutation kinds and optional opaque causal IDs,
|
|
184
|
+
never props, text, or command arguments. The upstream Solid artifact can include
|
|
185
|
+
signal value previews and optional source data, so it is local development/CI
|
|
186
|
+
material—not a production or hosted telemetry payload. Static names correlate
|
|
187
|
+
the two channels deterministically, but the artifact does not claim an exact
|
|
188
|
+
per-rerun-to-commit causal token that Solid does not yet expose.
|
|
189
|
+
|
|
190
|
+
Use `waitFor` when a timer, native-service fake, streamed chunk, or other
|
|
191
|
+
asynchronous source will update Solid state:
|
|
192
|
+
|
|
193
|
+
```tsx
|
|
194
|
+
const loaded = await screen.findByText("Loaded", { timeout: 2_000 });
|
|
195
|
+
|
|
196
|
+
// Or poll any synchronous assertion/value.
|
|
197
|
+
await screen.waitFor(() => screen.getByRole("button", { name: "Continue" }));
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Each attempt drains microtasks and flushes pending native mutations before
|
|
201
|
+
running the synchronous assertion. Timeouts and intervals are bounded; an
|
|
202
|
+
`AbortSignal` can cancel polling. A timeout preserves the last assertion as its
|
|
203
|
+
cause and includes a clipped native tree, so a failing test explains what was
|
|
204
|
+
actually committed.
|
|
205
|
+
|
|
206
|
+
Pass `hostOptions` to select a deterministic platform, capabilities, clock, or
|
|
207
|
+
custom descriptor set. Pass `host` when a test intentionally owns an existing
|
|
208
|
+
`InMemoryHost`; the two ownership modes cannot be combined.
|
|
209
|
+
|
|
210
|
+
Implemented:
|
|
211
|
+
|
|
212
|
+
- Atomic commit validation and rollback
|
|
213
|
+
- Create, update, move, remove, delete, and command mutations
|
|
214
|
+
- Ordered commit recording and surface snapshots
|
|
215
|
+
- Event injection and subscription cleanup
|
|
216
|
+
- Deterministic measurement responses
|
|
217
|
+
- Component descriptor and raw-text validation
|
|
218
|
+
- Application rendering with text, role, label, test-ID, and component queries
|
|
219
|
+
- General native-event delivery plus a discrete `press` convenience boundary
|
|
220
|
+
- Idempotent application cleanup with an exact destroyed-surface assertion
|
|
221
|
+
- A bounded first-party Node/OXC TSX test runner shared with generated apps
|
|
222
|
+
- A bounded, deterministic `debug()` view of the committed native tree
|
|
223
|
+
- A bounded, privacy-aware `debugCommits()` native transaction tail
|
|
224
|
+
- Render-scoped commit checkpoints and typed structural commit/mutation queries
|
|
225
|
+
- Abortable, bounded `waitFor()` polling for asynchronous Solid/native output
|
|
226
|
+
- Renderer conformance for Solid batching, reconciliation, refs, and cleanup
|
|
227
|
+
- Runtime compatibility and native-history synchronization tests
|
|
228
|
+
- A complete second renderer/navigation pass against Solid's development
|
|
229
|
+
runtime that fails on warnings or errors from Solid 2's ownership,
|
|
230
|
+
strict-read, lifecycle, and scheduler diagnostics
|
|
231
|
+
- Bounded `@solidjs/diagnostics` artifacts joined to value-free native commit
|
|
232
|
+
summaries, with official rerun/waste assertions, native transaction budgets,
|
|
233
|
+
and one strict checked-in policy format covering both channels
|
|
234
|
+
- An opt-in causal telemetry overhead benchmark with disabled, no-op sink,
|
|
235
|
+
resource-stamped no-op sink, and bounded local-timeline modes
|
|
236
|
+
- A native-navigation churn benchmark covering raw history, `NativeStack`, and
|
|
237
|
+
the TanStack/Solid 2 stack while validating exact owner disposal, bounded
|
|
238
|
+
final nodes, stable root identity, and two commits per push/pop cycle
|
|
239
|
+
|
|
240
|
+
Run the benchmark outside the correctness suite:
|
|
241
|
+
|
|
242
|
+
```sh
|
|
243
|
+
pnpm benchmark
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
It runs the causal instrumentation benchmark and the navigation churn
|
|
247
|
+
benchmark against the deterministic in-memory host. Neither represents Fabric,
|
|
248
|
+
device, React Native control, or compositor performance; see the repository
|
|
249
|
+
benchmark methodology before using the results.
|
|
250
|
+
|
|
251
|
+
Remaining testing tools:
|
|
252
|
+
|
|
253
|
+
- iOS/Android integration harness
|
|
254
|
+
- Accessibility and performance scenario runners
|
|
255
|
+
|
|
256
|
+
This renderer proves Solid ownership and host-contract behavior. It does not
|
|
257
|
+
simulate Fabric, Yoga, operating-system services, native navigation gestures,
|
|
258
|
+
or device performance; those claims still require the checked-in physical
|
|
259
|
+
integration runners.
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { type CaptureOptions, type DiagnosticsArtifact, type ScenarioBudget } from "@solidjs/diagnostics";
|
|
2
|
+
import type { CommitPriority, HostMutation } from "@solidnative-dev/host-contract";
|
|
3
|
+
import { type NativeTestRender, type RenderNativeOptions } from "./index.js";
|
|
4
|
+
export declare const NATIVE_DIAGNOSTICS_ARTIFACT_FORMAT_VERSION: 0;
|
|
5
|
+
export declare const NATIVE_DIAGNOSTICS_DEFAULT_MAX_RENDERS = 8;
|
|
6
|
+
export declare const NATIVE_DIAGNOSTICS_MAX_RENDERS = 32;
|
|
7
|
+
export declare const NATIVE_DIAGNOSTICS_DEFAULT_MAX_COMMITS_PER_RENDER = 100;
|
|
8
|
+
export declare const NATIVE_DIAGNOSTICS_MAX_COMMITS_PER_RENDER = 1000;
|
|
9
|
+
export declare const NATIVE_DIAGNOSTICS_MAX_LABEL_LENGTH = 128;
|
|
10
|
+
export declare const NATIVE_DIAGNOSTICS_BUDGET_FORMAT_VERSION: 1;
|
|
11
|
+
export declare const NATIVE_DIAGNOSTICS_MAX_BUDGET_FILE_BYTES = 1048576;
|
|
12
|
+
export declare const NATIVE_DIAGNOSTICS_MAX_BUDGET_SCENARIOS = 256;
|
|
13
|
+
export declare const NATIVE_DIAGNOSTICS_MAX_BUDGET_SCOPES = 256;
|
|
14
|
+
export declare const NATIVE_DIAGNOSTICS_MAX_ALLOWED_CODES = 128;
|
|
15
|
+
export type NativeDiagnosticsMutationKind = HostMutation["type"];
|
|
16
|
+
export interface NativeDiagnosticsCommitRecord {
|
|
17
|
+
readonly sequence: number;
|
|
18
|
+
readonly priority: CommitPriority;
|
|
19
|
+
readonly mutationCount: number;
|
|
20
|
+
readonly mutationCounts: Readonly<Partial<Record<NativeDiagnosticsMutationKind, number>>>;
|
|
21
|
+
readonly causalOperationId?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface NativeDiagnosticsRenderArtifact {
|
|
24
|
+
readonly renderId: number;
|
|
25
|
+
readonly surfaceName: string;
|
|
26
|
+
readonly commitCount: number;
|
|
27
|
+
readonly mutationCount: number;
|
|
28
|
+
readonly commits: readonly NativeDiagnosticsCommitRecord[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* One serializable development artifact joining Solid diagnostics and exact
|
|
32
|
+
* deterministic native transactions without retaining props or event values.
|
|
33
|
+
*/
|
|
34
|
+
export interface NativeDiagnosticsArtifact {
|
|
35
|
+
readonly formatVersion: typeof NATIVE_DIAGNOSTICS_ARTIFACT_FORMAT_VERSION;
|
|
36
|
+
readonly solid: DiagnosticsArtifact;
|
|
37
|
+
readonly renderCount: number;
|
|
38
|
+
readonly commitCount: number;
|
|
39
|
+
readonly mutationCount: number;
|
|
40
|
+
readonly renders: readonly NativeDiagnosticsRenderArtifact[];
|
|
41
|
+
}
|
|
42
|
+
export interface NativeDiagnosticsScenario {
|
|
43
|
+
render(code: () => unknown, options?: RenderNativeOptions): Promise<NativeTestRender>;
|
|
44
|
+
}
|
|
45
|
+
export interface CaptureNativeDiagnosticsOptions extends CaptureOptions {
|
|
46
|
+
/** Maximum renders a scenario may create. Defaults to 8; maximum 32. */
|
|
47
|
+
readonly maxRenders?: number;
|
|
48
|
+
/** Maximum commits retained for each render. Defaults to 100; maximum 1,000. */
|
|
49
|
+
readonly maxCommitsPerRender?: number;
|
|
50
|
+
}
|
|
51
|
+
export interface CaptureNativeDiagnosticsResult<T> {
|
|
52
|
+
readonly result: T;
|
|
53
|
+
readonly artifact: NativeDiagnosticsArtifact;
|
|
54
|
+
}
|
|
55
|
+
export interface NativeCommitBudget {
|
|
56
|
+
readonly maxCommits?: number;
|
|
57
|
+
readonly maxMutations?: number;
|
|
58
|
+
readonly maxCommitsPerRender?: number;
|
|
59
|
+
readonly maxMutationsPerCommit?: number;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A checked-in definition of done for one Solid Native diagnostics scenario.
|
|
63
|
+
* Solid's official bounds remain top-level; native transaction bounds occupy
|
|
64
|
+
* one explicit namespace so the file stays compatible with the upstream
|
|
65
|
+
* format instead of shadowing its fields.
|
|
66
|
+
*/
|
|
67
|
+
export interface NativeDiagnosticsScenarioBudget extends ScenarioBudget {
|
|
68
|
+
readonly native?: NativeCommitBudget;
|
|
69
|
+
}
|
|
70
|
+
export interface NativeDiagnosticsBudgetFile {
|
|
71
|
+
readonly formatVersion: typeof NATIVE_DIAGNOSTICS_BUDGET_FORMAT_VERSION;
|
|
72
|
+
readonly scenarios: Readonly<Record<string, NativeDiagnosticsScenarioBudget>>;
|
|
73
|
+
}
|
|
74
|
+
export declare class NativeDiagnosticsAssertionError extends Error {
|
|
75
|
+
constructor(message: string);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Captures one successful native test scenario through Solid's official
|
|
79
|
+
* development Diagnostics channels. Every render is disposed in reverse order
|
|
80
|
+
* before capture closes, so owner cleanup and its final native commit are part
|
|
81
|
+
* of the artifact.
|
|
82
|
+
*/
|
|
83
|
+
export declare function captureNativeDiagnostics<T>(scenario: (context: NativeDiagnosticsScenario) => T | Promise<T>, options?: CaptureNativeDiagnosticsOptions): Promise<CaptureNativeDiagnosticsResult<T>>;
|
|
84
|
+
/**
|
|
85
|
+
* Parses the shared Solid/native checked-in budget format without filesystem
|
|
86
|
+
* access. The input, scenario count, names, arrays, scope maps, regular
|
|
87
|
+
* expressions, numeric bounds, and accepted fields are all bounded before the
|
|
88
|
+
* resulting deeply frozen policy is returned.
|
|
89
|
+
*/
|
|
90
|
+
export declare function parseNativeDiagnosticsBudgetFile(json: string): NativeDiagnosticsBudgetFile;
|
|
91
|
+
/** Enforces Solid's official budget and the native transaction extension. */
|
|
92
|
+
export declare function assertNativeDiagnosticsBudget(artifact: NativeDiagnosticsArtifact, budget: NativeDiagnosticsScenarioBudget): void;
|
|
93
|
+
/**
|
|
94
|
+
* Selects the exact captured scenario from a checked-in policy and enforces
|
|
95
|
+
* both halves. Missing names fail closed so a new scenario cannot silently run
|
|
96
|
+
* without a reviewed budget.
|
|
97
|
+
*/
|
|
98
|
+
export declare function assertNativeDiagnosticsBudgetFile(artifact: NativeDiagnosticsArtifact, file: NativeDiagnosticsBudgetFile): void;
|
|
99
|
+
/** Gates native transaction volume alongside upstream rerun and waste budgets. */
|
|
100
|
+
export declare function expectNativeCommitBudget(artifact: NativeDiagnosticsArtifact, budget: NativeCommitBudget): void;
|
|
101
|
+
export declare function serializeNativeDiagnosticsArtifact(artifact: NativeDiagnosticsArtifact): string;
|
|
102
|
+
export { expectDiagnostic, expectNoDiagnostics, expectNoWaste, expectRerunBudget, } from "@solidjs/diagnostics";
|
|
103
|
+
//# sourceMappingURL=diagnostics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.d.ts","s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