Setting global variables in a script loaded by jsdom
问题 I'm trying to run some browser code in Node.js in order to simplify testing (deasync is the reason). Currently, I use jsdom to parse the only html file. At first, I was trying to make it also load the scripts, which are linked in <script> tags. But due to some stupid issues with relative file paths I have switched to passing a list of absolute paths to the script files as a parameter to jsdom.env function. Now I'm pretty sure that jsdom finds my scripts properly, but I cannot set any global