mochawesome-report-generator icon indicating copy to clipboard operation
mochawesome-report-generator copied to clipboard

Feat: customize reportDir

Open HOUCe opened this issue 4 years ago • 2 comments

Hey guy, thanks for the great work of mochawesome-report-generator.

I noticed that in getFilename function, it returns with path.resolve(process.cwd(), reportDir, filename). I've made this PR to add a rootDir option which equals process.cwd() by default.

Thanks again and wait for your reply.

HOUCe avatar Nov 08 '19 11:11 HOUCe

Not sure if this is really needed. You can specify a path relative to process.cwd() in the reportDir option. For example:

If your current directory is /myproject and you pass ../myreportdir as the reportDir option, your reports will be saved in a new directory at the same level as your project like below:

.
├── myproject
└── myreportdir
    ├── assets
    ├── mochawesome.json
    └── mochawesome.html

adamgruber avatar Nov 09 '19 16:11 adamgruber

Yes, to specify a path relative can resolve the problem, but it will be not super neat in my case, like:

('../../../A/B/C', reportDir)

I've made the same PR for mochawesome-merge

Issue 31

Anyway, it is not a block, (if it is) just a little improvement by my side. You can close this if it is necessary from most use case

HOUCe avatar Nov 11 '19 02:11 HOUCe