workers-sdk
workers-sdk copied to clipboard
🚀 Feature Request: Assets <> Vitest improvements
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
mockAssetshelper likemockFetchso 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": "..." }.
WC-2847 :)