diff --git a/package.json b/package.json index cac317b..8d598c8 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "author": "Raice Hannay ", "description": "A set of classes to make setting up React components for unit tests easy.", "license": "ISC", - "version": "1.0.2", + "version": "1.0.3", "keywords": [ "component", "enzyme", diff --git a/src/Wrapper.tsx b/src/Wrapper.tsx index f1cf8b8..1825fa1 100644 --- a/src/Wrapper.tsx +++ b/src/Wrapper.tsx @@ -1,4 +1,5 @@ import { ComponentType, mount, render, shallow } from "enzyme"; +import merge from "merge-deep"; import * as React from "react"; export default class Wrapper< @@ -95,11 +96,9 @@ export default class Wrapper< }; protected defineProps = () => { - this.mergedProps = { - children: this.scenarioChildren || this.defaultChildren, - ...this.defaultProps, - ...this.scenarioProps - }; + this.mergedProps = merge({}, this.defaultProps, this.scenarioProps, { + children: this.scenarioChildren || this.defaultChildren + }); return this.mergedProps; };