dojo / dojo/cli-test-intern

jsdom plugin is not correctly set up to handle bundled scenarios

Open
#113 0 comments 0 reactions 0 assignees View on GitHub
bug
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.