jest-junit report check will incorrectly fail if the reporter is provided via require.resolve
#201
Labels
untriaged
Requires traige
require.resolve
#201
rules_jest/jest/private/jest_config_template.mjs
Lines 43 to 54 in 7d4a398
This logic checks if the reporters needed are in the reporter array already, and if not adds it. However, you can have a reporter in the reporters array that is defined like this:
In this case, you are providing jest the reporter through an abolute path resolved by node. This will fail the name check because it won't match identically. This case matters for me because we centralize some of our jest infra so that consuming teams don't need to define it again and again.
Now, one could argue the most effective way to solve this is to globally declare
jest-junit
in your pnpm workspace, but I'm trying to avoid having global definitions when possible.It would be ideal if this logic supported full path resolves so it doesn't try to inject jest-junit twice and fail due to module resolution problems
The text was updated successfully, but these errors were encountered: