rstacruz/jsdom-global

How to use cleanup() with ES6 modules?

cagross opened this issue · 2 comments

Hey I know you can't spend too much time on this project anymore, but I just thought I'd ask, in case there's a relatively quick/easy answer. In the Usage section, it describes a way to cleanup, by calling cleanup like so:

var cleanup = require('jsdom-global')()
cleanup()

But what if I'm importing using ES6 modules? Then require is not defined. So is there another way to define cleanup? I tried a few ways, using the import keyword, but couldn't get anything to work :-/

If cleanup is instead something I need to do myself, in a more manual manner, that's fine--just let me know.

Yes awesome--that works! Thanks so much, it's a big help.

I'll close this issue then.