@reactra/testing 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 +17 -0
- package/dist/index.d.ts +63 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +183 -0
- package/dist/index.js.map +1 -0
- package/package.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Akhil Shastri and the Reactra 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
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @reactra/testing
|
|
2
|
+
|
|
3
|
+
> Reactra testing utilities — renderReactra and the __REACTRA_TEST__ hook.
|
|
4
|
+
|
|
5
|
+
**Alpha** — published under the npm dist-tag `alpha`. APIs may change before 1.0.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @reactra/testing@alpha
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Part of [Reactra](https://github.com/akhilshastri/reactra) — a compiler-first,
|
|
12
|
+
React-19-compatible framework. See the [documentation](https://reactra-docs.vercel.app) to get
|
|
13
|
+
started.
|
|
14
|
+
|
|
15
|
+
## License
|
|
16
|
+
|
|
17
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { type ComponentType } from "react";
|
|
2
|
+
import { type ReplayEvent, type SessionBundle } from "@reactra/behaviours/replayable";
|
|
3
|
+
/**
|
|
4
|
+
* The pinned shape of the emitted `__REACTRA_TEST__.update(name, bindings)` call
|
|
5
|
+
* (Testing §2 / B4). This is a DOCUMENTED protocol number, NOT an emitted value —
|
|
6
|
+
* the compiler emits no version into the hook line (golden byte-identical). It pins
|
|
7
|
+
* the call signature `update(componentName: string, bindings: Record<string, unknown>)`
|
|
8
|
+
* and the ordered-assembly key rule (props → state → derived → behaviour
|
|
9
|
+
* exposedBindings → actions → resources). Bump only on a breaking change to that
|
|
10
|
+
* signature or key rule; the S1 contract test asserts the current shape against it.
|
|
11
|
+
*/
|
|
12
|
+
export declare const TEST_HOOK_PROTOCOL: 1;
|
|
13
|
+
/** The hook interface the compiled test-hook line drives (Testing §2; protocol {@link TEST_HOOK_PROTOCOL}). */
|
|
14
|
+
export interface ReactraTestHook {
|
|
15
|
+
update(componentName: string, bindings: Record<string, unknown>): void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The binding handle: the component's bindings as properties/methods, plus the
|
|
19
|
+
* reserved members. Typed loosely — fixture components are compiled DSL, so the
|
|
20
|
+
* binding surface is dynamic by nature.
|
|
21
|
+
*/
|
|
22
|
+
export interface ReactraHandle {
|
|
23
|
+
unmount(): void;
|
|
24
|
+
settle(): Promise<void>;
|
|
25
|
+
rerender(props: Record<string, unknown>): void;
|
|
26
|
+
readonly renderCount: number;
|
|
27
|
+
/** The raw latest snapshot, unproxied — the escape hatch for shadowed names. */
|
|
28
|
+
readonly bindings: Record<string, unknown>;
|
|
29
|
+
[binding: string]: any;
|
|
30
|
+
}
|
|
31
|
+
export interface RenderReactraOptions {
|
|
32
|
+
props?: Record<string, unknown>;
|
|
33
|
+
/** Wrap the harness root in <StrictMode>. OFF by default for deterministic renderCount. */
|
|
34
|
+
strict?: boolean;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Mount a compiled Reactra component and return its binding handle
|
|
38
|
+
* (Testing spec §3). Requires a DOM in the test environment.
|
|
39
|
+
*/
|
|
40
|
+
export declare const renderReactra: (Component: ComponentType<Record<string, unknown>>, opts?: RenderReactraOptions) => ReactraHandle;
|
|
41
|
+
export interface CaptureReplayOptions extends RenderReactraOptions {
|
|
42
|
+
/** Extra configureReplay options merged over { enabled: true } (e.g. redactKeys). */
|
|
43
|
+
replay?: {
|
|
44
|
+
redactKeys?: readonly string[];
|
|
45
|
+
maxEvents?: number;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Record a component session: enable recording, mount, run `drive`, unmount,
|
|
50
|
+
* finalize (Testing §4). Recording is ALWAYS reset to the disabled default
|
|
51
|
+
* afterwards — even when `drive` throws — so it never leaks into later tests.
|
|
52
|
+
*/
|
|
53
|
+
export declare const captureReplayBundle: (Component: ComponentType<Record<string, unknown>>, drive: (c: ReactraHandle) => void, opts?: CaptureReplayOptions) => Promise<SessionBundle | null>;
|
|
54
|
+
/** Async variant — awaits `drive` and settles effects before finalizing (RP-04). */
|
|
55
|
+
export declare const captureReplayBundleAsync: (Component: ComponentType<Record<string, unknown>>, drive: (c: ReactraHandle) => Promise<void>, opts?: CaptureReplayOptions) => Promise<SessionBundle | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Build a `SessionBundle` around partial events — fills the format boilerplate
|
|
58
|
+
* (Replay §3) so headless ReplayPlayer tests need no renderer.
|
|
59
|
+
*/
|
|
60
|
+
export declare const createTestBundle: (events: ReadonlyArray<Partial<ReplayEvent> & {
|
|
61
|
+
type: ReplayEvent["type"];
|
|
62
|
+
}>) => SessionBundle;
|
|
63
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAkC,KAAK,aAAa,EAAE,MAAM,OAAO,CAAA;AAE1E,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,aAAa,EACnB,MAAM,gCAAgC,CAAA;AAOvC;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,EAAG,CAAU,CAAA;AAE5C,+GAA+G;AAC/G,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CACvE;AAqCD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,IAAI,IAAI,CAAA;IACf,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;IAC9C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,gFAAgF;IAChF,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAG1C,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAA;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,2FAA2F;IAC3F,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED;;;GAGG;AACH,eAAO,MAAM,aAAa,GACxB,WAAW,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACjD,OAAM,oBAAyB,KAC9B,aAuEF,CAAA;AAMD,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE,qFAAqF;IACrF,MAAM,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAChE;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,WAAW,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACjD,OAAO,CAAC,CAAC,EAAE,aAAa,KAAK,IAAI,EACjC,OAAM,oBAAyB,KAC9B,OAAO,CAAC,aAAa,GAAG,IAAI,CAU9B,CAAA;AAED,oFAAoF;AACpF,eAAO,MAAM,wBAAwB,GACnC,WAAW,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EACjD,OAAO,CAAC,CAAC,EAAE,aAAa,KAAK,OAAO,CAAC,IAAI,CAAC,EAC1C,OAAM,oBAAyB,KAC9B,OAAO,CAAC,aAAa,GAAG,IAAI,CAW9B,CAAA;AAMD;;;GAGG;AACH,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC,KAC1E,aAwBF,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
// @reactra/testing — the renderer-driven test harness (Testing spec v1.0).
|
|
2
|
+
//
|
|
3
|
+
// Owner spec: reactra-testing-spec.md. `renderReactra` mounts a compiled
|
|
4
|
+
// component and returns the binding HANDLE the Undo §8 / Replay §9 scenarios
|
|
5
|
+
// are written against; the enabling mechanism is the guarded test hook the
|
|
6
|
+
// compiler emits into every component (Compiler §4 Pass 9 v2.18):
|
|
7
|
+
// `useEffect(() => { globalThis.__REACTRA_TEST__?.update(name, bindings) })`.
|
|
8
|
+
// Node-portable source (CLAUDE.md §6); the DOM itself is the test
|
|
9
|
+
// environment's job (happy-dom / jsdom).
|
|
10
|
+
import { act, createElement, StrictMode } from "react";
|
|
11
|
+
import { createRoot } from "react-dom/client";
|
|
12
|
+
import { configureReplay, finalizeReplay, } from "@reactra/behaviours/replayable";
|
|
13
|
+
// ---------------------------------------------------------------------------
|
|
14
|
+
// The test hook (Testing spec §2). Installed once, idempotently; tracks the
|
|
15
|
+
// latest committed bindings snapshot + update count per component name.
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
/**
|
|
18
|
+
* The pinned shape of the emitted `__REACTRA_TEST__.update(name, bindings)` call
|
|
19
|
+
* (Testing §2 / B4). This is a DOCUMENTED protocol number, NOT an emitted value —
|
|
20
|
+
* the compiler emits no version into the hook line (golden byte-identical). It pins
|
|
21
|
+
* the call signature `update(componentName: string, bindings: Record<string, unknown>)`
|
|
22
|
+
* and the ordered-assembly key rule (props → state → derived → behaviour
|
|
23
|
+
* exposedBindings → actions → resources). Bump only on a breaking change to that
|
|
24
|
+
* signature or key rule; the S1 contract test asserts the current shape against it.
|
|
25
|
+
*/
|
|
26
|
+
export const TEST_HOOK_PROTOCOL = 1;
|
|
27
|
+
const instances = new Map();
|
|
28
|
+
const installHook = () => {
|
|
29
|
+
// Idempotent: re-installing must not lose per-component records mid-test.
|
|
30
|
+
const g = globalThis;
|
|
31
|
+
g.IS_REACT_ACT_ENVIRONMENT = true;
|
|
32
|
+
if (g.__REACTRA_TEST__)
|
|
33
|
+
return;
|
|
34
|
+
g.__REACTRA_TEST__ = {
|
|
35
|
+
update(componentName, bindings) {
|
|
36
|
+
const rec = instances.get(componentName);
|
|
37
|
+
if (rec) {
|
|
38
|
+
rec.bindings = bindings;
|
|
39
|
+
rec.updateCount++;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
instances.set(componentName, { bindings, updateCount: 1 });
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
// renderReactra + the handle (Testing spec §3).
|
|
49
|
+
// ---------------------------------------------------------------------------
|
|
50
|
+
/** Reserved handle members (Testing §3) — NOT DSL-reserved keywords; on the handle they win. */
|
|
51
|
+
const RESERVED = new Set(["unmount", "settle", "renderCount", "rerender", "bindings"]);
|
|
52
|
+
/**
|
|
53
|
+
* Mount a compiled Reactra component and return its binding handle
|
|
54
|
+
* (Testing spec §3). Requires a DOM in the test environment.
|
|
55
|
+
*/
|
|
56
|
+
export const renderReactra = (Component, opts = {}) => {
|
|
57
|
+
if (typeof document === "undefined") {
|
|
58
|
+
throw new Error("[reactra:testing] renderReactra needs a DOM. Register one in your test environment " +
|
|
59
|
+
"(e.g. happy-dom's GlobalRegistrator, or jsdom) before mounting. (Testing spec §5.)");
|
|
60
|
+
}
|
|
61
|
+
installHook();
|
|
62
|
+
const name = Component.displayName ?? Component.name;
|
|
63
|
+
// A fresh mount owns this component name's record (latest-reporter-wins — TLIM-02).
|
|
64
|
+
instances.delete(name);
|
|
65
|
+
const container = document.createElement("div");
|
|
66
|
+
document.body.appendChild(container);
|
|
67
|
+
const root = createRoot(container);
|
|
68
|
+
const mount = (props) => {
|
|
69
|
+
const el = createElement(Component, props);
|
|
70
|
+
act(() => {
|
|
71
|
+
root.render(opts.strict ? createElement(StrictMode, null, el) : el);
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
mount(opts.props ?? {});
|
|
75
|
+
// Collision detection (Testing §3): on the first update after mount, a
|
|
76
|
+
// component binding shadowed by a reserved member warns once per renderReactra call.
|
|
77
|
+
const rec = instances.get(name);
|
|
78
|
+
if (rec) {
|
|
79
|
+
const shadowed = Object.keys(rec.bindings).filter((k) => RESERVED.has(k));
|
|
80
|
+
if (shadowed.length > 0) {
|
|
81
|
+
console.warn(`[reactra:testing] component "${name}" declares binding(s) ${shadowed
|
|
82
|
+
.map((s) => `"${s}"`)
|
|
83
|
+
.join(", ")} shadowed by reserved handle members — reach them via c.bindings.<name>. ` +
|
|
84
|
+
`(Testing spec §3.)`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
const reserved = {
|
|
88
|
+
unmount: () => {
|
|
89
|
+
act(() => root.unmount());
|
|
90
|
+
container.remove();
|
|
91
|
+
},
|
|
92
|
+
settle: async () => {
|
|
93
|
+
await act(async () => { });
|
|
94
|
+
},
|
|
95
|
+
rerender: (props) => {
|
|
96
|
+
mount(props);
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
return new Proxy({}, {
|
|
100
|
+
get(_t, prop) {
|
|
101
|
+
if (prop === "renderCount")
|
|
102
|
+
return instances.get(name)?.updateCount ?? 0;
|
|
103
|
+
if (prop === "bindings")
|
|
104
|
+
return instances.get(name)?.bindings ?? {};
|
|
105
|
+
if (RESERVED.has(prop))
|
|
106
|
+
return reserved[prop];
|
|
107
|
+
const value = instances.get(name)?.bindings[prop];
|
|
108
|
+
// Function bindings (actions, undo/redo, …) run inside act() so the
|
|
109
|
+
// resulting state updates are committed before the call returns.
|
|
110
|
+
if (typeof value === "function") {
|
|
111
|
+
return (...args) => {
|
|
112
|
+
let out;
|
|
113
|
+
act(() => {
|
|
114
|
+
out = value(...args);
|
|
115
|
+
});
|
|
116
|
+
return out;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
return value;
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Record a component session: enable recording, mount, run `drive`, unmount,
|
|
125
|
+
* finalize (Testing §4). Recording is ALWAYS reset to the disabled default
|
|
126
|
+
* afterwards — even when `drive` throws — so it never leaks into later tests.
|
|
127
|
+
*/
|
|
128
|
+
export const captureReplayBundle = async (Component, drive, opts = {}) => {
|
|
129
|
+
configureReplay({ enabled: true, ...opts.replay });
|
|
130
|
+
try {
|
|
131
|
+
const c = renderReactra(Component, opts);
|
|
132
|
+
drive(c);
|
|
133
|
+
c.unmount();
|
|
134
|
+
return await finalizeReplay();
|
|
135
|
+
}
|
|
136
|
+
finally {
|
|
137
|
+
configureReplay({ enabled: false });
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
/** Async variant — awaits `drive` and settles effects before finalizing (RP-04). */
|
|
141
|
+
export const captureReplayBundleAsync = async (Component, drive, opts = {}) => {
|
|
142
|
+
configureReplay({ enabled: true, ...opts.replay });
|
|
143
|
+
try {
|
|
144
|
+
const c = renderReactra(Component, opts);
|
|
145
|
+
await drive(c);
|
|
146
|
+
await c.settle();
|
|
147
|
+
c.unmount();
|
|
148
|
+
return await finalizeReplay();
|
|
149
|
+
}
|
|
150
|
+
finally {
|
|
151
|
+
configureReplay({ enabled: false });
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
// ---------------------------------------------------------------------------
|
|
155
|
+
// createTestBundle (Testing spec §4 — RP-02's pure builder).
|
|
156
|
+
// ---------------------------------------------------------------------------
|
|
157
|
+
/**
|
|
158
|
+
* Build a `SessionBundle` around partial events — fills the format boilerplate
|
|
159
|
+
* (Replay §3) so headless ReplayPlayer tests need no renderer.
|
|
160
|
+
*/
|
|
161
|
+
export const createTestBundle = (events) => {
|
|
162
|
+
const full = events.map((e, i) => ({
|
|
163
|
+
componentId: "Test#1",
|
|
164
|
+
timestamp: 1000 + i,
|
|
165
|
+
...(e.type === "action" ? { name: "action", payload: [], duration: 0 } : {}),
|
|
166
|
+
...(e.type === "resource" ? { name: "resource", status: "resolved" } : {}),
|
|
167
|
+
...(e.type === "mount" ? { phase: "mount" } : {}),
|
|
168
|
+
...(e.type === "state_snapshot" ? { state: {} } : {}),
|
|
169
|
+
...e,
|
|
170
|
+
}));
|
|
171
|
+
const first = full[0]?.timestamp ?? 0;
|
|
172
|
+
const last = full[full.length - 1]?.timestamp ?? first;
|
|
173
|
+
return {
|
|
174
|
+
version: "2.0",
|
|
175
|
+
mode: "state-snapshot",
|
|
176
|
+
startTime: first,
|
|
177
|
+
duration: last - first,
|
|
178
|
+
sessionId: "ses_test",
|
|
179
|
+
components: [...new Set(full.map((e) => e.componentId.split("#")[0]))],
|
|
180
|
+
events: full,
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,yEAAyE;AACzE,6EAA6E;AAC7E,2EAA2E;AAC3E,kEAAkE;AAClE,8EAA8E;AAC9E,kEAAkE;AAClE,yCAAyC;AAEzC,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,UAAU,EAAsB,MAAM,OAAO,CAAA;AAC1E,OAAO,EAAE,UAAU,EAAa,MAAM,kBAAkB,CAAA;AACxD,OAAO,EACL,eAAe,EACf,cAAc,GAGf,MAAM,gCAAgC,CAAA;AAEvC,8EAA8E;AAC9E,4EAA4E;AAC5E,wEAAwE;AACxE,8EAA8E;AAE9E;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAU,CAAA;AAY5C,MAAM,SAAS,GAAG,IAAI,GAAG,EAA0B,CAAA;AAEnD,MAAM,WAAW,GAAG,GAAS,EAAE;IAC7B,0EAA0E;IAC1E,MAAM,CAAC,GAAG,UAGT,CAAA;IACD,CAAC,CAAC,wBAAwB,GAAG,IAAI,CAAA;IACjC,IAAI,CAAC,CAAC,gBAAgB;QAAE,OAAM;IAC9B,CAAC,CAAC,gBAAgB,GAAG;QACnB,MAAM,CAAC,aAAa,EAAE,QAAQ;YAC5B,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;YACxC,IAAI,GAAG,EAAE,CAAC;gBAC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,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjD,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,gBAAgB,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrD,GAAG,CAAC;KACL,CAAgB,CACpB,CAAA;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,SAAS,IAAI,CAAC,CAAA;IACrC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,SAAS,IAAI,KAAK,CAAA;IACtD,OAAO;QACL,OAAO,EAAE,KAAK;QACd,IAAI,EAAE,gBAAgB;QACtB,SAAS,EAAE,KAAK;QAChB,QAAQ,EAAE,IAAI,GAAG,KAAK;QACtB,SAAS,EAAE,UAAU;QACrB,UAAU,EAAE,CAAC,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC;QACvE,MAAM,EAAE,IAAI;KACb,CAAA;AACH,CAAC,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@reactra/testing",
|
|
3
|
+
"version": "0.1.0-alpha.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"default": "./dist/index.js"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@reactra/behaviours": "^0.1.0-alpha.0"
|
|
14
|
+
},
|
|
15
|
+
"peerDependencies": {
|
|
16
|
+
"react": "^19.2.0",
|
|
17
|
+
"react-dom": "^19.2.0"
|
|
18
|
+
},
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist"
|
|
22
|
+
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public",
|
|
25
|
+
"tag": "alpha",
|
|
26
|
+
"provenance": false
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/akhilshastri/reactra.git",
|
|
31
|
+
"directory": "packages/testing"
|
|
32
|
+
},
|
|
33
|
+
"homepage": "https://reactra-docs.vercel.app",
|
|
34
|
+
"license": "MIT",
|
|
35
|
+
"engines": {
|
|
36
|
+
"node": ">=22.18"
|
|
37
|
+
},
|
|
38
|
+
"sideEffects": false,
|
|
39
|
+
"description": "Reactra testing utilities — renderReactra and the __REACTRA_TEST__ hook."
|
|
40
|
+
}
|