Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use @edge-runtime/jest-environment with collectCoverage: true and coverageProvider: 'babel' #250

Open
ondrej-langr opened this issue Feb 2, 2023 · 0 comments

Comments

@ondrej-langr
Copy link

Bug Report

Current behavior

When the jest is run with collectCoverage option set to true and coverageProvider set to 'babel' the actual test run fails with this error:
image

What is being imported does not really matter - if I remove imports by moving contents of that file in it just fails at something different (same error though).

Expected behavior/code

Tests should run normally without this error.

Possible solution

What I find working is to switch from 'babel' to 'v8', but that may not be the best solution.

Additional context/screenshots

App is in next and Im testing parts of nextjs middleware (NextRequest/NextResponse from "next/server" package). I also made sure that no new Function/eval is being present in third party deps that are being imported during the test.

Node version: 16.18.1
NPM version: 8.19.2
Jest version: 28.1.3

will be glad for any pointers/thoughts/ideas on this matter 💗
Will be glad to include more info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant