How to correctly setup Miniflare & Miniflare Jest Testing with a Cloudflare Worker on GitHub Actions

Stack Overflow
How to correctly setup Miniflare & Miniflare Jest Testing with a Cl...
I am really struggling to correctly setup a Miniflare Enviroment with a Cloudflare Worker on GitHub Actions so I can use Miniflare Jest to perform Jest testing. So far, I have followed the guides
4 Replies
DaniFoldi
DaniFoldi•2y ago
does it work locally? I see you have an ancient node version specified, miniflare needs at least 16.13.0
sadisticautism
sadisticautismOP•2y ago
Negatory, will update that now see if it helps. Failing up to: Run npm run miniflare &
[email protected] miniflare npx miniflare ../src/index.ts
npm ERR! could not determine executable to run npm ERR! A complete log of this run can be found in: npm ERR! /home/runner/.npm/_logs/2023-06-25T14_10_26_499Z-debug-0.log npm ERR! Missing script: "test" npm ERR! npm ERR! To see a list of scripts, run: npm ERR! npm run npm ERR! A complete log of this run can be found in: npm ERR! /home/runner/.npm/_logs/2023-06-25T14_10_31_205Z-debug-0.log Error: Process completed with exit code 1. All packages are supported on 18
DaniFoldi
DaniFoldi•2y ago
as indicated by the error, you're missing a script called test
sadisticautism
sadisticautismOP•2y ago
Getting closer, export default { SyntaxError: Unexpected token 'export' Just enable "type":"module"? Sorted that issue, now I'm getting: ENOENT: no such file or directory, open '/home/runner/work/edge/edge/dist/worker.js' should be? ./dist/index.mjs"
Want results from more Discord servers?
Add your server