@barefootjs/test 0.3.0 → 0.4.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/dist/index.js +1 -1
- package/dist/test-node.d.ts +12 -1
- package/dist/test-node.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/test-node.ts +13 -2
package/dist/index.js
CHANGED
|
@@ -194767,7 +194767,7 @@ class TestNode {
|
|
|
194767
194767
|
return this.handlers.submit;
|
|
194768
194768
|
}
|
|
194769
194769
|
on(event) {
|
|
194770
|
-
return this.handlers[event]
|
|
194770
|
+
return this.handlers[event];
|
|
194771
194771
|
}
|
|
194772
194772
|
constructor(data) {
|
|
194773
194773
|
this.tag = data.tag;
|
package/dist/test-node.d.ts
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Produced by converting the compiler IR into a flat, assertion-friendly shape.
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* Statically-resolved wiring for a single event handler.
|
|
8
|
+
*
|
|
9
|
+
* `setters`/`via` are populated only for handlers that reach raw signal setters
|
|
10
|
+
* declared in the component — directly (`onClick={() => setX(1)}`) or through
|
|
11
|
+
* local helper functions (`via`). Handlers backed by a library's
|
|
12
|
+
* property-access method — e.g. `@barefootjs/form`'s `name.handleInput` or
|
|
13
|
+
* `form.handleSubmit` — register the event but report empty `setters`/`via`,
|
|
14
|
+
* because the setter calls live inside the library, not the component body.
|
|
15
|
+
*/
|
|
6
16
|
export interface EventHandler {
|
|
7
17
|
setters: string[];
|
|
8
18
|
via: string[];
|
|
@@ -45,7 +55,8 @@ export declare class TestNode implements TestNodeData {
|
|
|
45
55
|
get onInput(): EventHandler | undefined;
|
|
46
56
|
get onChange(): EventHandler | undefined;
|
|
47
57
|
get onSubmit(): EventHandler | undefined;
|
|
48
|
-
|
|
58
|
+
/** Returns the handler wired to `event`, or `undefined` if none — matching the shorthand getters. */
|
|
59
|
+
on(event: string): EventHandler | undefined;
|
|
49
60
|
constructor(data: TestNodeData);
|
|
50
61
|
/** Return the first descendant (or self) matching the query. */
|
|
51
62
|
find(query: TestNodeQuery): TestNode | null;
|
package/dist/test-node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-node.d.ts","sourceRoot":"","sources":["../src/test-node.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,GAAG,EAAE,MAAM,EAAE,CAAA;CACd;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IAClB,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,YAAY,GAAG,aAAa,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,CAAA;IAC3F,QAAQ,EAAE,QAAQ,EAAE,CAAA;IACpB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC,CAAA;IAC9C,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAA;IAC/C,QAAQ,EAAE,OAAO,CAAA;IACjB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,qBAAa,QAAS,YAAW,YAAY;IAC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AQ,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAA;IAC/C,QAAQ,EAAE,OAAO,CAAA;IACjB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAE5B,IAAI,OAAO,IAAI,YAAY,GAAG,SAAS,CAA+B;IACtE,IAAI,OAAO,IAAI,YAAY,GAAG,SAAS,CAA+B;IACtE,IAAI,QAAQ,IAAI,YAAY,GAAG,SAAS,CAAgC;IACxE,IAAI,QAAQ,IAAI,YAAY,GAAG,SAAS,CAAgC;IAExE,qGAAqG;IACrG,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAE1C;IAED,YAAY,IAAI,EAAE,YAAY,EAc7B;IAED,gEAAgE;IAChE,IAAI,CAAC,KAAK,EAAE,aAAa,GAAG,QAAQ,GAAG,IAAI,CAO1C;IAED,4DAA4D;IAC5D,OAAO,CAAC,KAAK,EAAE,aAAa,GAAG,QAAQ,EAAE,CAIxC;IAED,wEAAwE;IACxE,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAOxC;IAED,OAAO,CAAC,OAAO;IAOf,OAAO,CAAC,cAAc;CAMvB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@barefootjs/test",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Test utilities for BarefootJS - IR-based component testing without a browser",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"directory": "packages/test"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@barefootjs/jsx": "0.
|
|
42
|
+
"@barefootjs/jsx": "0.4.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"typescript": "^5.0.0"
|
package/src/test-node.ts
CHANGED
|
@@ -4,6 +4,16 @@
|
|
|
4
4
|
* Produced by converting the compiler IR into a flat, assertion-friendly shape.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Statically-resolved wiring for a single event handler.
|
|
9
|
+
*
|
|
10
|
+
* `setters`/`via` are populated only for handlers that reach raw signal setters
|
|
11
|
+
* declared in the component — directly (`onClick={() => setX(1)}`) or through
|
|
12
|
+
* local helper functions (`via`). Handlers backed by a library's
|
|
13
|
+
* property-access method — e.g. `@barefootjs/form`'s `name.handleInput` or
|
|
14
|
+
* `form.handleSubmit` — register the event but report empty `setters`/`via`,
|
|
15
|
+
* because the setter calls live inside the library, not the component body.
|
|
16
|
+
*/
|
|
7
17
|
export interface EventHandler {
|
|
8
18
|
setters: string[]
|
|
9
19
|
via: string[]
|
|
@@ -51,8 +61,9 @@ export class TestNode implements TestNodeData {
|
|
|
51
61
|
get onChange(): EventHandler | undefined { return this.handlers.change }
|
|
52
62
|
get onSubmit(): EventHandler | undefined { return this.handlers.submit }
|
|
53
63
|
|
|
54
|
-
|
|
55
|
-
|
|
64
|
+
/** Returns the handler wired to `event`, or `undefined` if none — matching the shorthand getters. */
|
|
65
|
+
on(event: string): EventHandler | undefined {
|
|
66
|
+
return this.handlers[event]
|
|
56
67
|
}
|
|
57
68
|
|
|
58
69
|
constructor(data: TestNodeData) {
|