Macos – xvfb-run on Mac OSX

macosxvfb

I'm trying to run SlimerJS in headless mode so that it does not open a visible browser window on Mac OSX.

According to the SlimerJS docs, this can be done using xvfb which is "available on Linux and MacOS", using the command:

>> xvfb-run ./slimerjs myscript.js.

Although OSX comes with bundled with xvfb, it does not have the corresponding xvfb-run script.

How can I get the same functionality using the OSX xvfb version?

Best Answer

You can try something like the following (works for me with running my python test cases):

$ Xvfb :1337 & export DISPLAY=:1337 & ./slimerjs myscript.js.