It would be awesome if there was a umd build so that this could be used with something like QUnit which is run in the browser. This way the lib could be included via a script tag either downloaded or with unpkg and be ready to use in environments without module loading.
This might make more sense over in the dom-testing-library repo, but I'm putting it here since the intended use is with react.
Similar to React or other libs that export umd builds, it would mean exporting exporting a global like ReactTestingLib or maybe something shorter (open to suggestions).
P.S. I can work on a PR for this feature. Seems like it would be fun.
Switch test runners (big effort).
Build example of using this in an environment with no module loading. Purely script tags in a page.
We can definitely do this. kcd-scripts build supports this via a --bundle flag. I think that'd probably be fine because people should be requiring the commonjs files directly anyway. Let me give this a shot...
Well, there's a UMD build for dom-testing-library now, but I'm struggling to get react-dom/test-utils to build with the UMD bundle of react-testing-library. I'd like to drop that dependency anyway though so I'm looking at ways to do that. I'm feeling pretty good about my progress, but there are still some complications and things that need to be worked out thanks to how react does things with events. Hopefully when we can drop the Simulate dependency entirely though we'll be able to have a good UMD build :)
:tada: This issue has been resolved in version 5.2.3 :tada:
The release is available on:
npm package (@latest dist-tag)Your semantic-release bot :package::rocket:
Most helpful comment
Well, there's a UMD build for dom-testing-library now, but I'm struggling to get
react-dom/test-utilsto build with the UMD bundle of react-testing-library. I'd like to drop that dependency anyway though so I'm looking at ways to do that. I'm feeling pretty good about my progress, but there are still some complications and things that need to be worked out thanks to how react does things with events. Hopefully when we can drop the Simulate dependency entirely though we'll be able to have a good UMD build :)