jsdom plugin is not correctly set up to handle bundled scenarios
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 17
- PR merge metrics
- No merged PRs in 30d
Description
**Bug**
The jsdom plugin in `cli-test-intern` is not currently implemented correctly for bundles (ie using `dojo test -c local`).
It imports both `@dojo/shim` and `@dojo/has` modules to set things on, but those modules have no correlation with what is actually bundled. We should likely favour setting things directly on the global in node here (given the jsdom plugin is only used in a node env anyway). I'm not sure how important the `has` flag for `jsdom` is either so perhaps we can drop that?
It also seems like due to our `global` implementation in `dojo/shim` (which checks for a global first over a window) and the way we are just attaching the jsdom `window` to `global.window` results in this not working. To fix we could either change our global implementation to test for `window` first, or we have to spread the jsdom `window` over the node `global`. If we are going to do the latter we should consider https://github.com/rstacruz/jsdom-global perhaps
Contributor guide
Assessment
This issue has not been assessed yet.