You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
swc/jest - maximum (out of) coverage value channges based on tests run #112
When running Jest tests with coverage enabled, reporters such as text text-summary and html show a value of coverage out of a maximum number. This value shouldn't change as it represents the maximum potential coverage for the files scanned by Jest from collectCoverageFrom. However it does change when I add or remove tests or if I only run a sub set of tests.
The processAsync method is almost exactly the same as the process except it doesn't do the jestOptions.supportsStaticESM check and instead just defaults to es6:
module: {
...swcOptionsForProcess.module,
// async transform is always ESM
type: "es6" as any,
},
I was able to confirm the numbers are reliably consistent when:
Converting the project test runner to support es6 modules, or
Hacking the @swc/jest transformer so that the type is commonjs in processAsync
I don't know if this difference in code was an oversight or has been done on purpose but using the same logic from process in processAsync seems to give a more accurate result.
Activity