How does code mirror recognize on what system it runs?

I’d like to write unit tests for my editor, and I’m working with keybindings. I can see that it contains logic depending on the operating system, for example how Mod- is handled.

I would like to somehow spoof or override what codeMirror considers the actual operating system, for the sake of tests. How can I do that?

Never mind, found it: view/src/browser.ts at main · codemirror/view · GitHub