Hazyzh / jest-html-reporters

🌈 Reporter for jest test framework. 🌈
https://hazyzh.github.io/report.html
MIT License
522 stars 100 forks source link

Text colorization missing when built on GitLab #223

Closed smith558 closed 1 year ago

smith558 commented 2 years ago

when built locally image when built on GitLab image

Hazyzh commented 2 years ago

Hi @smith558 , that's interesting, I didn't do anything special regarding Gitlab, don't know why the styles were not working. I guess there are some CSS conflicts with GitLab default CSS.

Maybe you can inspect Gitlab the report file to say why it does not take effect?

smith558 commented 2 years ago

In fact, it's not that CSS would not take effect. It's something regarding the Jest output and how it's passed onto the HTML builder. It's passed as a pure text block when built on GitLab in contrast with when built locally and the output is HTML formatted and styled elements.

when built locally:

Expected: <span style="color:#0A0">0<span style="color:#595959">
Received: <span style="color:#A00">-2<span style="color:#595959">

image

built on GitLab: image

Hazyzh commented 2 years ago

Interesting, seems you don't get colorful output on your gitlab machine. I guess this issue not related to the report, it's maybe a bug of Jest. https://github.com/facebook/jest/issues/9459