testing-library / testing-library/dom-testing-library
have main detect node vs browser
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.3k
- Forks
- 474
- PR merge metrics
- No merged PRs in 30d
Description
Describe the feature you'd like:
According to this comment: https://github.com/DevExpress/testcafe/issues/4176#issuecomment-523916838 it may be possible for dom testing library to detect if its being used in node or in a browser.
The feature I'm requesting is to have it use the UMD module if it's in the browser and if not the existing main.
Suggested implementation:
🤔
Describe alternatives you've considered:
Teachability, Documentation, Adoption, Migration Strategy:
would not break anything, would just allow main to be used in the browser (via umd)
This will help w/ client script injection for testcafe testing library and make it a bit easier to inject DTL on the page.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the package entry points referred to as main and UMD, along with how the library is selected in Node versus a browser. Confirm the expected browser and Node loading behavior, then verify that browser use selects the UMD module without breaking the existing main entry.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100