Describe the bug
attachTo and hydrateIn options set in enzyme.configure are ignored.
To Reproduce
In a mocha test suite, add the following code in a before section:
const node = document.createElement('div');
node.className = 'my-class';
enzyme.configure({ attachTo: node });
Then in a test, mount any node without options and test whether its parent in the DOM has the class my-class. It doesn't.
Expected behavior
If attachTo is set in configure and not set in the options when calling mount the option from configure should be used.
Additional context
The issue originated in #1707 and is due to how mountTargets gets merged with the configuration. Even if a mount target is undefined it still overrides the configuration.
I can submit a PR to fix this at some point, but I'm not sure when I'll get around to it. I'm happy for someone else to pick it up earlier if they want to.
Describe the bug
attachToandhydrateInoptions set inenzyme.configureare ignored.To Reproduce
In a mocha test suite, add the following code in a
beforesection:Then in a test, mount any node without options and test whether its parent in the DOM has the class
my-class. It doesn't.Expected behavior
If
attachTois set inconfigureand not set in the options when callingmountthe option fromconfigureshould be used.Additional context
The issue originated in #1707 and is due to how
mountTargetsgets merged with the configuration. Even if a mount target isundefinedit still overrides the configuration.I can submit a PR to fix this at some point, but I'm not sure when I'll get around to it. I'm happy for someone else to pick it up earlier if they want to.