FuncUnit is pretty awesome. But it might not be clear how it works in Browser vs Command (Selenium) mode. To help, I put together 2 quick illustrations that highlight what's going on.
First, lets look at what happens when you open a FuncUnit test page with your browser:
Browser Mode
Essentially, 'S' provides a bunch of methods for selecting elements in a popup window and performing actions on them or getting information about them. QUnit is used for reporting and conditionals.
Lets see what happens in Command Mode:
In command mode, we use Envjs to open the same FuncUnit page. Envjs is a 'headless' browser. A headless browser is a browser that runs in a command line and you can't see the rendered page. But you CAN interact with the page with JavaScript.
When a FuncUnit page is opened up with Envjs, it knows to start Selenium. Then when your tests are run, they use Selenium to issue commands to the popup window. By using Envjs Selenium, we automated the same process that happens in "Browser" mode.
Conclusion
I hope this is helpful. It's rather rough. But if you find these 'infographics' helpful, we will produce more of them.