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?

export default defineWorkersConfig({
    test: {
        poolOptions: {
            workers: {
                wrangler: { configPath: './wrangler.toml' },
                miniflare: {
                    r2Buckets: {
                        MY_BUCKET: 'sing-box-config',
                        // 'sing-box-config': 'MY_BUCKET',
                    },
                },
            },
        },
    },
});
Was this page helpful?