Closed fernandopasik closed 5 years ago
Sadly, this is not possible due to the way jest works. Jest-screenshot runs in as well the processes executing the tests as a reporter writing the report after all tests have finished. The code you proposed would only be executed in the processes executing the tests but not for the reporter. Hence an external configuration file is needed.
I actually also would have preferred to specify the configuration when calling setupJestScrenshot
.
If you ever find a way to implement this, please let me know, I'd love to integrate it.
ahh, so this would not work? https://github.com/Prior99/jest-screenshot/pull/12
I will try to have a look at it on the weekend. Thanks.
Nice @Prior99 A quick test locally shows that it works fine to pass along a config in the setup. At least with jest v24. Would ♥️ to hear form You about the #12 in a couple of days.
I guess this can be closed now with #12 merged and published? Sorry for the delay by the way.
Yes! this looks good, thanks!
Hi
Would it be possible to setup options when doing the jest framework setup?
I find it a bit better than having to add a json file in the root folder just for configuring this library. Usually all jest related config goes into a setupTestFrameworkScriptFile.
The key in package.json doesn't seem like a good option either as it would pollute the file.
Thanks!