workers-sdk icon indicating copy to clipboard operation
workers-sdk copied to clipboard

🚀 Feature Request: Assets <> Vitest improvements

Open GregBrimble opened this issue 1 year ago • 1 comments

Describe the solution

Two things to consider:

  • Consider triggering an auto-rerun of tests when Vitest is running in interactive mode when an asset is modified. Modifying Worker source already automatically triggers an auto-rerun. Should assets too?
  • Consider a mockAssets helper like mockFetch so we can stub out a partial build without needing to wait for a whole thing (e.g. massive Gatsby site), and/or, test how my Worker script behaves when it encounters different types of assets without needing to have a totally different build pipeline for test and prod. I'd probably want to just provide it a virtual filesystem interface, or a object of { "my/file.html": "<html>", "other/image.jpg": "..." }.

GregBrimble avatar Oct 14 '24 07:10 GregBrimble

WC-2847 :)

emily-shen avatar Oct 14 '24 13:10 emily-shen