@uniflowed/react-testing 0.0.0-alpha.7 → 0.0.0-alpha.8

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.
@@ -111,7 +111,10 @@ const ALSO_BUBBLES: { readonly [string]: string } = {
111
111
  * stays one cast at one line rather than a dozen errors at every call.
112
112
  */
113
113
  function construct(name: string, init: EventInit): Event {
114
- // One cast, covering the lookup and both constructions; see above.
114
+ // One cast, covering the lookup and both constructions; see above. Suppressed
115
+ // rather than left to fail `check:lib`, because the half that would have to
116
+ // change is Flow's library definition for the event initialiser dictionaries.
117
+ // uf-lint-disable-next-line flow/unclear-type
115
118
  const classes: any = globalThis;
116
119
  const Constructor = classes[EVENT_TYPES[name] ?? "Event"] ?? classes.Event;
117
120
  const options = optionsFor(name, init);
@@ -210,9 +213,14 @@ export function dispatch(target: EventTarget, name: string, init?: EventInit): b
210
213
  * that stops answering to the hundred-and-first. That is a design decision
211
214
  * about a published API and not a cast to remove in passing.
212
215
  *
213
- * Left as `any` rather than renamed to `$FlowFixMe`, which would move it out
214
- * of `flow/unclear-type`'s sight without moving it out of the package.
216
+ * Suppressed by name rather than renamed to `$FlowFixMe`. The rename would
217
+ * move it out of `flow/unclear-type`'s sight and say nothing; the directive
218
+ * below names the rule it is escaping, is checked by
219
+ * `uniflowed/unknown-lint-suppression`, and can be counted — this is one of
220
+ * the seven in the packages, and ubugeeei-prod/uf#401 is the design decision
221
+ * that would remove it.
215
222
  */
223
+ // uf-lint-disable-next-line flow/unclear-type
216
224
  export const fireEvent: any = new Proxy(
217
225
  (target: EventTarget, name: string, init?: EventInit) => dispatch(target, name, init),
218
226
  {
@@ -212,8 +212,10 @@ export function actively<T>(body: () => T): T {
212
212
  // for every call would hand `act(() => {})` a floating promise, and
213
213
  // returning the scope itself would depend on React's thenable passing the
214
214
  // callback's value through, which is the assumption the comment above
215
- // records going wrong. So the cast stays, visible to `flow/unclear-type`
216
- // rather than renamed to `$FlowFixMe` to quiet it.
215
+ // records going wrong. So the cast stays, suppressed by name rather than
216
+ // renamed to `$FlowFixMe`: the directive says which rule it is escaping and
217
+ // this comment says why, which a rename says nothing about.
218
+ // uf-lint-disable-next-line flow/unclear-type
217
219
  return Promise.resolve(scope).then(() => result) as any;
218
220
  }
219
221
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniflowed/react-testing",
3
- "version": "0.0.0-alpha.7",
3
+ "version": "0.0.0-alpha.8",
4
4
  "description": "React Testing Library over a real DOM, part of the Unified Toolchain for Flow.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -18,8 +18,8 @@
18
18
  "internal"
19
19
  ],
20
20
  "dependencies": {
21
- "@uniflowed/core": "0.0.0-alpha.7",
22
- "@uniflowed/react": "0.0.0-alpha.7",
21
+ "@uniflowed/core": "0.0.0-alpha.8",
22
+ "@uniflowed/react": "0.0.0-alpha.8",
23
23
  "happy-dom": "^20.13.2"
24
24
  },
25
25
  "peerDependencies": {