Hi folks I m trying to run a jest test

Hi folks. I'm trying to run a jest test with miniflare on my worker / durable object. However, I get this error: SyntaxError: Unexpected token 'export' at VMScriptRunner.runAsModule (../../node_modules/@miniflare/runner-vm/src/index.ts:34:20) at VMScriptRunner.run (../../node_modules/@miniflare/runner-vm/src/index.ts:86:28) at EventTarget.#reload (../../node_modules/@miniflare/core/src/index.ts:790:42) at EventTarget.getGlobalScope (../../node_modules/@miniflare/core/src/index.ts:1038:5) at createMiniflareEnvironment (../../node_modules/@miniflare/shared-test-environment/src/index.ts:79:25) at MiniflareEnvironment.setup (../../node_modules/jest-environment-miniflare/src/index.ts:123:33) Any ideas what I'm doing wrong?
1 Reply
MrBBot
MrBBot•2y ago
Hey! 👋 Apologies for the delayed response here. If this is still an issue for you, could you try add testEnvironmentOptions: { modules: true } to your Jest config?
Want results from more Discord servers?
Add your server