https://gist.github.com/davetron5000/3d8dbc405b5a0a18f68668301e555e23
You have to setup the HTML before doing any JSDOM stuff, as well as set up any fetch expectations. Then, when the custom elements are defined, stuff happens and the test is called.
[screenshot is code available in the gist]