How can I test native macOS UI software in a container before deployment? As part of the CI setup, I'd like to run (automated) tests on native macOS GUI software in a 'safe environment' (i.e. without messing with the host software installation too much). Virtual machines (using VirtualBox) work in principle, but they are fairly slow to start/stop and VirtualBox on macOS hosts doesn't seem to be very stable (it works great on Linux hosts though).

After reading macOS testing on Desktop: Docker containers vs. Homebrew installation I learned that using Docker works great for testing software on macOS. However, my understanding is that even with Docker Desktop for Mac (which uses Hyperkit to virtualize the OS as opposed to running VMs using VirtualBox), the software running in the container sees a Linux installation.

Would it be plausible to use Docker anyway (maybe I misunderstood it?) such that the containerized program sees a macOS installation or would some other solution (A plain chroot?) work better here?
I can confirm that running Docker on Mac works just fine, but according to this ServerFault question, it's not possible to just run MacOS in Docker. 

(You might be able to run MacOS in a VM in a Docker container, but that's probably not what you want.)

You could purchase a MacMini, use it as a Jenkins slave and run automated tests on it as part of your build pipeline or something like that?