How can I make miniflare persit R2 data on local in testing?
I have a worker and it need to access R2. I want to run test locally and make R2 load files from local dir.
are there any options I can add here?
3 Replies
Hey! 👋 Unfortunately, this isn't possible at the moment. This was a deliberate choice to ensure that tests are reproducible, as they always start with an empty environment. If you'd like to seed data before running your tests, I'd encourage you to configure VItest
setupFiles
(https://vitest.dev/config/#setupfiles) with something like...
well I will have a try.
and which is bucket binding which is bucket name in r2Buckets?
BINDING: name or name:BINDING
BINDING: name
🙂