lwc icon indicating copy to clipboard operation
lwc copied to clipboard

Use `engine-server` fixtures in hydration tests

Open nolanlawson opened this issue 1 year ago • 4 comments

Right now our hydration tests (in integration-karma) are distinct from our engine-server tests. However, we have great code coverage in engine-server/src/__tests__/fixtures. We could:

  • Have an additional set of hydration tests that pull from the engine-server fixtures
  • These hydration tests would merely assert that the content renders on the server and the client and does not encounter any hydration mismatch warnings.

nolanlawson avatar Dec 05 '24 21:12 nolanlawson

This issue has been linked to a new work item: W-17381895

git2gus[bot] avatar Dec 06 '24 00:12 git2gus[bot]

Would this be a good opportunity to move the fixtures in engine-server to a separate folder? That could simplify things for the ssr-compiler which is doing this too. Although engine-server would remain producing the reference expectations for ssr-compiler.

I would create it outside the packages folder though, as it feels already bloated with private packages which could benefit a lot from not sharing the same configs and build scripts.

On a second thought, maybe this should be a separate PR, even if this one is done first.

cardoso avatar Dec 06 '24 13:12 cardoso

These hydration tests would merely assert that the content renders on the server and the client and does not encounter any hydration mismatch warnings.

Will it benefit from running in every browser in CI? I would expect this to be fairly browser-independent, but probably wishful thinking.

cardoso avatar Dec 06 '24 15:12 cardoso

Would this be a good opportunity to move the fixtures in engine-server to a separate folder?

I don't have a strong opinion on this. Although eventually they will have to move, since engine-server will be deprecated. 🙂

Will it benefit from running in every browser in CI?

Call it paranoia. 😆 We rarely have browser-specific hydration bugs, but you never know.

nolanlawson avatar Dec 06 '24 17:12 nolanlawson