Skip to content

Commit c9c85cb

Browse files
author
Raice Hannay
committed
replace lodash.merge with merge-deep
1 parent b641db3 commit c9c85cb

File tree

6 files changed

+116
-211
lines changed

6 files changed

+116
-211
lines changed

docs/WrapperWithRedux.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
This abstract class has a `WrappingComponent` defined which wraps the component in a Redux `Provider`,
55
passing in the return value from the `createStore` method.
66

7-
To use this class, you have to extend it and define your own `createStore` method to return an
8-
instance of your Redux store, using the `initialState` and `middlewares` that this class provides -
9-
it is important to ensure that your store uses these, because if it disregards them, none of the
10-
methods this class provides will function.
7+
To use this class, you have to extend it, pass in your store state type in the class declaration and
8+
define your own `createStore` method to return an instance of your Redux store, using the
9+
`initialState` and `middlewares` that this class provides - it is important to ensure that your
10+
store uses these, because if it disregards them, none of the methods this class provides will function.
1111

1212

1313
Public read-only properties
@@ -50,7 +50,7 @@ import * as React from "react";
5050
import { IntlConfig } from "react-intl";
5151
import { WrapperWithRedux as BaseWrapper } from "react-test-wrapper";
5252

53-
import { createStore } from "../store/createStore";
53+
import { createStore, TStoreState } from "../store";
5454

5555
class Wrapper<
5656
C extends React.ComponentType<any>,

global.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
declare module "merge-deep";

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"author": "Raice Hannay <[email protected]>",
44
"description": "A set of classes to make setting up React components for unit tests easy.",
55
"license": "ISC",
6-
"version": "1.0.0",
6+
"version": "1.0.1",
77
"keywords": [
88
"component",
99
"enzyme",
@@ -88,6 +88,6 @@
8888
"typescript-fsa-reducers": "^1.2.1"
8989
},
9090
"dependencies": {
91-
"lodash.merge": "^4.6.2"
91+
"merge-deep": "^3.0.2"
9292
}
9393
}

src/WrapperWithRedux.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import merge from "lodash.merge";
1+
import merge from "merge-deep";
22
import * as React from "react";
33
import { Provider } from "react-redux";
44
import { AnyAction, DeepPartial, Middleware, Store } from "redux";

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
"noUnusedLocals": true,
1818
"noUnusedParameters": true
1919
},
20-
"include": ["./src/index.ts"],
20+
"include": ["./global.d.ts", "./src/index.ts"],
2121
"exclude": ["**/coverage/*", "**/dist/*", "**/node_modules/*"]
2222
}

0 commit comments

Comments
 (0)