-
Notifications
You must be signed in to change notification settings - Fork 47.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: UMD version of react-test-renderer #12572
Comments
I'm curious, what would this be used for? react and react-dom have UMD versions because it enables them to be run in a browser without any transform/bundling step. But the test renderer isn't really useful without a test runner, which should be capable of consuming the CJS build. |
Thanks for the response! I'm working in an environment where npm isn't allowed (among other things) -- so we use Jasmine Standalone (SpecRunner) on the browser for JS Unit Testing. I was planning to create some wrappers around react-dom-test-utils, react-test-renderer and react-test-renderer-shallow to make the testing slightly less painful. |
Gotcha. If you're not using NPM to install, would you be willing to just create your own UMD test renderer bundle? It would be pretty simple:
diff --git a/scripts/rollup/bundles.js b/scripts/rollup/bundles.js
index 138017b5d..bcf99ae52 100644
--- a/scripts/rollup/bundles.js
+++ b/scripts/rollup/bundles.js
@@ -156,7 +156,7 @@ const bundles = [
/******* React Test Renderer *******/
{
label: 'test',
- bundleTypes: [FB_DEV, NODE_DEV, NODE_PROD],
+ bundleTypes: [UMD_DEV, UMD_PROD],
moduleType: RENDERER,
entry: 'react-test-renderer',
global: 'ReactTestRenderer',
Should give you a bundle that exports a global |
I guess it doesn't hurt us to add a UMD for it. |
Sure. I'll toss up a PR for consideration. |
Ok @srb101, the next release of the test renderer will have a UMD build. In the meanwhile, here you go: |
react and react-dom have both cjs and umd versions available.
Is it possible to create a umd version of react-test-renderer as well?
The text was updated successfully, but these errors were encountered: