jest-community / jest-junit

A Jest reporter that creates compatible junit xml files
Apache License 2.0
483 stars 109 forks source link

Handle boolean values in addition to strings within config #225

Closed AndreasHae closed 2 years ago

AndreasHae commented 2 years ago

I lost a lot of time trying to configure unique output names because I was passing the uniqueOutputName parameter as true (boolean) instead of "true" (string). Only after manually checking the project's source code, I found that it only checks for strings. That's a major footgun when configuring directly using jest.config.js. Seems like an easy fix as well.

I'm using version 14.0.1.

palmerj3 commented 2 years ago

It's not an easy fix unless we remove the ability to configure jest-junit via environment variables. A lot of teams are dependent on this functionality so this is why we have a not ideal ergonomics here.

Always open to better docs or for someone to magically fix this with a PR.

AndreasHae commented 1 year ago

I think there's a misunderstanding. I don't want to replace the existing option to be configured by the string "true", I just want to extend it to also allow using the boolean true. This should not break environment variables. See my PR for further info.