Hazyzh / jest-html-reporters

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

Webstorm/Intellij Idea support for addMsg #209

Closed Kremliovskyi closed 2 years ago

Kremliovskyi commented 2 years ago

Describe the bug Whenever I run test from Intellij Idea/Webstorm I can not execute tests when I use addMsg functions. It works fine if run from cli.

To Reproduce Steps to reproduce the behavior:

  1. Run test from Intellij Idea/Webstorm gui image

  2. Observe error -> Error: ENOENT: no such file or directory, open 'C:\Users\AKREML~1\AppData\Local\Temp\akremlovskyi-QzpcVXNlcnNcYWtyZW1sb3Zza3lpXElkZWFQcm9qZWN0c1xhcGktZTJlLXRlc3Rz\jest-html-reporters-temp\data\16522037482340.40829737615116457.json'

Expected behavior Test should run

Screenshots image image

Desktop (please complete the following information):

Hazyzh commented 2 years ago

Hi @Kremliovskyi , which version are you using now? it's wried, we have encounter this issue before and already trying to fix it https://github.com/Hazyzh/jest-html-reporters/pull/116. don't know why you can not found the system temp dir in you Intellij Ide. I don't have that IDE right now, will have a try later.

Kremliovskyi commented 2 years ago

Hi @Hazyzh , IntelliJ IDEA 2021.3.1 (Ultimate Edition) and "jest-html-reporters": "^3.0.8"

Kremliovskyi commented 2 years ago

workaround

    async addLog(log: string) {
        try {
            // @ts-ignore
            await addMsg({message: log})
        } catch (ignore) {}
    }
Hazyzh commented 2 years ago

Hi @Kremliovskyi , I can not reproduce this issue on my side. I guess maybe your IDE do not have write access to system temp directory. Could you modify report temp dir by the env variable config JEST_HTML_REPORTERS_TEMP_DIR_PATH and have a try again?