"Christopher M. Miles" <numbch...@gmail.com> writes: >> I think that the best we can do in this situation is mocking >> `create-image' in batch mode to return non-nil using `cl-letf'. > > I checked the `create-image' in image.el source code, don't know how to > mocking this. I have no experience and idea about this. I also searched > org testing. Have not found similar situations. > > If you have idea how to write this test, I suggest pass this word to > you. What do you think?
I imagine something like ;; Mock `create-image' to work noninteractively. (cl-letf (((symbol-function 'create-image) (lambda (&rest _) `(image :type "dummy" :data "dummy")))) <your test code here>) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>