kolodny / safetest

MIT License
1.31k stars 31 forks source link

Initial solidjs support #3

Closed mosheduminer closed 3 months ago

mosheduminer commented 3 months ago

Follow up from https://github.com/kolodny/safetest/issues/1

Outstanding issues:

  1. getting warning: "You appear to have multiple instances of Solid. This can lead to unexpected behavior." This often occurs when there are conflicting version requirements, or when a library has bundled solid into its own distribution (solid relies on a global singleton to keep track of reactive primitives). I suspect that the latter has happened here, although solid isn't bundled, safetest has it's own copy of solid in node_modules, distinct from the copy used in the example app. Does that seem plausible? In any case, the application code isn't affected, I think only the solid code contained in safetest is affected (see the next point).
  2. getting warning: "computations created outside a createRoot or render will never be disposed". This is probably the same issue as above, due to the createMemo and createRenderEffect used in safetest/solid using a different copy of solid, but it's possible that it's actually a symptom I misconfigured something.
  3. The last line of the example safetest (await expect(text).toHaveCSS("text-decoration", "line-through");) throws without any text in its error, despite the app code appearing to be behaving correctly.

Regarding createOverride, I wasn't exactly sure of the full extent of the features meant to be provided by react-overrides, so I did not include that API (at least for now).

mosheduminer commented 3 months ago

Okay, so the only remaining issue is number 3 above. I have a feeling this is a playwright bug rather than anything to do with safetest code though.

kolodny commented 3 months ago

The issue with 3 was it was not matching the entire text, I changed it to a regex and it passed. I also fixed up the error reporting for when that fails. Thanks for this PR!

mosheduminer commented 3 months ago

Thanks!