Skip to content

Commit 40239f5

Browse files
author
Raice Hannay
committed
update dependencies
1 parent 0dc42cd commit 40239f5

14 files changed

+1612
-1513
lines changed

Diff for: jest.config.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ module.exports = {
66
branches: 100,
77
functions: 100,
88
lines: 100,
9-
statements: 100
10-
}
9+
statements: 100,
10+
},
1111
},
1212
globals: {
1313
"ts-jest": {
1414
tsConfig: {
15-
target: "es6"
16-
}
17-
}
15+
target: "es6",
16+
},
17+
},
1818
},
1919
moduleDirectories: ["node_modules"],
2020
preset: "ts-jest",
@@ -25,7 +25,7 @@ module.exports = {
2525
testMatch: ["**/*.test.{ts,tsx}"],
2626
testURL: "http://localhost",
2727
transformIgnorePatterns: [
28-
"/node_modules/(?!intl-messageformat|intl-messageformat-parser).+\\.js$"
28+
"/node_modules/(?!intl-messageformat|intl-messageformat-parser).+\\.js$",
2929
],
30-
verbose: true
30+
verbose: true,
3131
};

Diff for: package.json

+26-26
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": "2.0.2",
6+
"version": "2.0.3",
77
"keywords": [
88
"component",
99
"enzyme",
@@ -62,38 +62,38 @@
6262
}
6363
},
6464
"devDependencies": {
65-
"@types/enzyme": "^3.10.3",
66-
"@types/enzyme-adapter-react-16": "^1.0.5",
67-
"@types/jest": "^24.0.23",
68-
"@types/react": "^16.9.15",
69-
"@types/react-redux": "^7.1.5",
70-
"@typescript-eslint/eslint-plugin": "^2.22.0",
71-
"cross-env": "^6.0.3",
72-
"enzyme": "^3.10.0",
73-
"enzyme-adapter-react-16": "^1.15.1",
74-
"enzyme-to-json": "^3.4.3",
65+
"@types/enzyme": "^3.10.5",
66+
"@types/enzyme-adapter-react-16": "^1.0.6",
67+
"@types/jest": "^25.1.4",
68+
"@types/react": "^16.9.31",
69+
"@types/react-redux": "^7.1.7",
70+
"@typescript-eslint/eslint-plugin": "^2.26.0",
71+
"cross-env": "^7.0.2",
72+
"enzyme": "^3.11.0",
73+
"enzyme-adapter-react-16": "^1.15.2",
74+
"enzyme-to-json": "^3.4.4",
7575
"eslint": "^6.8.0",
76-
"eslint-config-voodoocreation": "^1.0.8",
77-
"eslint-plugin-import": "^2.20.1",
78-
"eslint-plugin-jest": "^23.8.1",
76+
"eslint-config-voodoocreation": "^1.1.1",
77+
"eslint-plugin-import": "^2.20.2",
78+
"eslint-plugin-jest": "^23.8.2",
7979
"eslint-plugin-jsx-a11y": "^6.2.3",
8080
"eslint-plugin-prefer-arrow": "^1.1.7",
81-
"eslint-plugin-react": "^7.18.3",
82-
"eslint-plugin-react-hooks": "^2.5.0",
83-
"jest": "^24.9.0",
81+
"eslint-plugin-react": "^7.19.0",
82+
"eslint-plugin-react-hooks": "^3.0.0",
83+
"jest": "^25.2.4",
8484
"npm-run-all": "^4.1.5",
85-
"prettier": "^1.19.1",
86-
"react": "^16.12.0",
87-
"react-dom": "^16.12.0",
88-
"react-intl": "^3.9.1",
89-
"react-redux": "^7.1.3",
90-
"redux": "^4.0.4",
91-
"ts-jest": "^24.2.0",
92-
"typescript": "^3.7.3",
85+
"prettier": "^2.0.2",
86+
"react": "^16.13.1",
87+
"react-dom": "^16.13.1",
88+
"react-intl": "^4.3.1",
89+
"react-redux": "^7.2.0",
90+
"redux": "^4.0.5",
91+
"ts-jest": "^25.3.0",
92+
"typescript": "^3.8.3",
9393
"typescript-fsa": "^3.0.0",
9494
"typescript-fsa-reducers": "^1.2.1"
9595
},
9696
"dependencies": {
97-
"ts-deepmerge": "^1.0.4"
97+
"ts-deepmerge": "^1.0.5"
9898
}
9999
}

Diff for: src/Wrapper.test.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Wrapper from "./Wrapper";
77
describe("Wrapper", () => {
88
describe("when using the different render methods", () => {
99
const component = new Wrapper(Dummy).withDefaultProps({
10-
value: "Default value"
10+
value: "Default value",
1111
});
1212

1313
describe("when using 'shallow'", () => {
@@ -93,7 +93,7 @@ describe("Wrapper", () => {
9393

9494
describe("when using the props API", () => {
9595
const component = new Wrapper(Dummy).withDefaultProps({
96-
value: "Default value"
96+
value: "Default value",
9797
});
9898

9999
it("renders with default props correctly", () => {
@@ -106,7 +106,7 @@ describe("Wrapper", () => {
106106
it("renders with test-specific props correctly", () => {
107107
const wrapper = component
108108
.withProps({
109-
value: "Test value"
109+
value: "Test value",
110110
})
111111
.render();
112112

Diff for: src/Wrapper.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default class Wrapper<
5454

5555
const props = this.defineProps() as P;
5656
const wrapper = mount<P>(<this.Component {...props} />, {
57-
wrappingComponent: this.WrappingComponent
57+
wrappingComponent: this.WrappingComponent,
5858
});
5959

6060
this.reset();
@@ -108,7 +108,7 @@ export default class Wrapper<
108108
this.mergedProps = {
109109
...this.defaultProps,
110110
...this.scenarioProps,
111-
children: this.scenarioChildren || this.defaultChildren
111+
children: this.scenarioChildren || this.defaultChildren,
112112
};
113113

114114
return this.mergedProps;

Diff for: src/WrapperWithIntl.test.tsx

+4-7
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,16 @@ import Wrapper, { messages } from "../test/TestWrapperWithIntl";
33

44
describe("WrapperWithIntl", () => {
55
const component = new Wrapper(IntlDummy).withDefaultProps({
6-
value: "Default value"
6+
value: "Default value",
77
});
88

99
describe("when using the 'shallow' method", () => {
1010
const wrapper = component.shallow();
1111

1212
it("renders the correct BUTTON message", () => {
13-
expect(
14-
wrapper
15-
.render()
16-
.find(".Dummy--button")
17-
.text()
18-
).toBe(messages.BUTTON);
13+
expect(wrapper.render().find(".Dummy--button").text()).toBe(
14+
messages.BUTTON
15+
);
1916
});
2017
});
2118

Diff for: src/WrapperWithIntl.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export default abstract class WrapperWithIntl<
1414
defaultLocale: "en",
1515
locale: navigator.language,
1616
messages: {},
17-
...this.intlProviderProps
17+
...this.intlProviderProps,
1818
};
1919
}
2020

Diff for: src/WrapperWithRedux.test.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import Wrapper from "../test/TestWrapperWithRedux";
66

77
const initialState = {
88
test: {
9-
value: "Default value"
10-
}
9+
value: "Default value",
10+
},
1111
};
1212

1313
const component = new Wrapper(ConnectedDummy).withDefaultReduxState(
@@ -56,8 +56,8 @@ describe("WrapperWithRedux", () => {
5656
const wrapper = component
5757
.withReduxState({
5858
test: {
59-
value: "Test value"
60-
}
59+
value: "Test value",
60+
},
6161
})
6262
.mount();
6363

@@ -173,8 +173,8 @@ describe("WrapperWithRedux", () => {
173173
it("updates the store", () => {
174174
expect(wrapper.store.getState()).toEqual({
175175
test: {
176-
value: payload
177-
}
176+
value: payload,
177+
},
178178
});
179179
});
180180

Diff for: src/WrapperWithRedux.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default abstract class WrapperWithRedux<
5353
const wrapper: TWrapperWithStore<P, S> = mount<P>(
5454
<this.Component {...props} />,
5555
{
56-
wrappingComponent: this.WrappingComponent
56+
wrappingComponent: this.WrappingComponent,
5757
}
5858
);
5959

@@ -88,11 +88,11 @@ export default abstract class WrapperWithRedux<
8888

8989
protected beforeMount = () => {
9090
this.reduxStore = this.createStore(this.mergedReduxState, [
91-
this.reduxHistoryMiddleware
91+
this.reduxHistoryMiddleware,
9292
]);
9393
};
9494

95-
protected reduxHistoryMiddleware: Middleware = () => next => action => {
95+
protected reduxHistoryMiddleware: Middleware = () => (next) => (action) => {
9696
this.dispatchedActions.push(action);
9797
return next(action);
9898
};

Diff for: test/Dummy.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export class Dummy extends React.Component<IProps> {
3131

3232
export const ConnectedDummy = connect(
3333
(state: TStoreState) => ({
34-
value: state.test.value
34+
value: state.test.value,
3535
}),
3636
actions
3737
)(Dummy);

Diff for: test/IntlDummy.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as React from "react";
22
import {
33
FormattedMessage,
44
injectIntl,
5-
WrappedComponentProps
5+
WrappedComponentProps,
66
} from "react-intl";
77
import { connect } from "react-redux";
88

@@ -39,7 +39,7 @@ export const IntlDummy = injectIntl(Dummy);
3939
export const ConnectedDummy = injectIntl(
4040
connect(
4141
(state: TStoreState) => ({
42-
value: state.test.value
42+
value: state.test.value,
4343
}),
4444
actions
4545
)(Dummy)

Diff for: test/TestWrapperWithIntl.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import { IntlConfig } from "react-intl";
44
import WrapperWithIntl from "../src/WrapperWithIntl";
55

66
export const messages = {
7-
BUTTON: "Button"
7+
BUTTON: "Button",
88
};
99

1010
export default class TestWrapperWithIntl<
1111
C extends React.ComponentType<any>,
1212
P extends React.ComponentProps<C> = React.ComponentProps<C>
1313
> extends WrapperWithIntl<C, P> {
1414
protected intlProviderProps: Partial<IntlConfig> = {
15-
messages
15+
messages,
1616
};
1717
}

Diff for: test/reducer.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,21 @@ export interface ITestState {
88
}
99

1010
const testInitialState: ITestState = {
11-
value: ""
11+
value: "",
1212
};
1313

1414
const testReducer = reducerWithInitialState(testInitialState).case(
1515
actions.setValue,
1616
(state, payload) => ({
1717
...state,
18-
value: payload
18+
value: payload,
1919
})
2020
);
2121

2222
export const initialState = {
23-
test: testInitialState
23+
test: testInitialState,
2424
};
2525

2626
export default combineReducers({
27-
test: testReducer
27+
test: testReducer,
2828
});

Diff for: test/store.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ import {
33
compose,
44
createStore as reduxStore,
55
DeepPartial,
6-
Middleware
6+
Middleware,
77
} from "redux";
8+
import merge from "ts-deepmerge";
89

910
import rootReducer, { initialState as rootInitialState } from "./reducer";
1011

@@ -16,6 +17,6 @@ export const createStore = (
1617
) =>
1718
reduxStore(
1819
rootReducer,
19-
initialState,
20+
merge(rootInitialState, initialState),
2021
compose(applyMiddleware(...middlewares))
2122
);

0 commit comments

Comments
 (0)