Skip to content

Commit fde793c

Browse files
committed
chore: upgrade deps & bump version
1 parent b2745e5 commit fde793c

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-cool-starter",
3-
"version": "3.8.2",
3+
"version": "3.9.0",
44
"description": "A starter boilerplate for a universal web application with the best development experience and best practices.",
55
"license": "MIT",
66
"homepage": "https://github.com/wellyshen/react-cool-starter",
@@ -225,7 +225,7 @@
225225
"dependencies": {
226226
"@babel/plugin-proposal-class-properties": "^7.10.1",
227227
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
228-
"@babel/preset-env": "^7.10.1",
228+
"@babel/preset-env": "^7.10.2",
229229
"@babel/preset-react": "^7.10.1",
230230
"@babel/preset-typescript": "^7.10.1",
231231
"@babel/register": "^7.10.1",
@@ -268,7 +268,7 @@
268268
"ts-node": "^8.10.2"
269269
},
270270
"devDependencies": {
271-
"@babel/core": "^7.10.1",
271+
"@babel/core": "^7.10.2",
272272
"@loadable/webpack-plugin": "^5.12.0",
273273
"@testing-library/jest-dom": "^5.9.0",
274274
"@testing-library/react": "^10.0.4",
@@ -337,7 +337,7 @@
337337
"stylelint-prettier": "^1.1.2",
338338
"stylelint-scss": "^3.17.2",
339339
"terser-webpack-plugin": "^3.0.2",
340-
"ts-jest": "^26.0.0",
340+
"ts-jest": "^26.1.0",
341341
"typescript": "^3.9.3",
342342
"url-loader": "^4.1.0",
343343
"webpack": "^4.43.0",

src/pages/Home/__tests__/Home.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import mockStore from "../../../utils/mockStore";
77
import Home from "../Home";
88

99
describe("<Home />", () => {
10-
const tree = (
10+
const renderHelper = (
1111
reducer: Record<string, unknown> = { readyStatus: "invalid" }
1212
) => {
1313
const { dispatch, ProviderWithStore } = mockStore({ home: reducer });
@@ -23,7 +23,7 @@ describe("<Home />", () => {
2323
};
2424

2525
it("should fetch data when page loaded", () => {
26-
const { dispatch } = tree();
26+
const { dispatch } = renderHelper();
2727

2828
expect(dispatch).toHaveBeenCalledTimes(1);
2929
expect(dispatch.mock.calls[0][0].toString()).toBe(
@@ -32,19 +32,19 @@ describe("<Home />", () => {
3232
});
3333

3434
it("renders the loading status if data invalid", () => {
35-
expect(tree().firstChild).toMatchSnapshot();
35+
expect(renderHelper().firstChild).toMatchSnapshot();
3636
});
3737

3838
it("renders the loading status if requesting data", () => {
3939
const reducer = { readyStatus: "request" };
4040

41-
expect(tree(reducer).firstChild).toMatchSnapshot();
41+
expect(renderHelper(reducer).firstChild).toMatchSnapshot();
4242
});
4343

4444
it("renders an error if loading failed", () => {
4545
const reducer = { readyStatus: "failure" };
4646

47-
expect(tree(reducer).firstChild).toMatchSnapshot();
47+
expect(renderHelper(reducer).firstChild).toMatchSnapshot();
4848
});
4949

5050
it("renders the <UserList /> if loading was successful", () => {
@@ -53,6 +53,6 @@ describe("<Home />", () => {
5353
list: [{ id: "1", name: "Welly" }],
5454
};
5555

56-
expect(tree(reducer).firstChild).toMatchSnapshot();
56+
expect(renderHelper(reducer).firstChild).toMatchSnapshot();
5757
});
5858
});

src/pages/UserInfo/__tests__/UserInfo.test.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import UserInfo from "../UserInfo";
88

99
describe("<UserInfo />", () => {
1010
const id = "1";
11-
const tree = (reducer: Record<string, unknown> = {}) => {
11+
const renderHelper = (reducer: Record<string, unknown> = {}) => {
1212
const { dispatch, ProviderWithStore } = mockStore({ userInfo: reducer });
1313
const { container } = render(
1414
<ProviderWithStore>
@@ -22,7 +22,7 @@ describe("<UserInfo />", () => {
2222
};
2323

2424
it("should fetch data when page loaded", () => {
25-
const { dispatch } = tree();
25+
const { dispatch } = renderHelper();
2626

2727
expect(dispatch).toHaveBeenCalledTimes(1);
2828
expect(dispatch.mock.calls[0][0].toString()).toBe(
@@ -31,19 +31,19 @@ describe("<UserInfo />", () => {
3131
});
3232

3333
it("renders the loading status if data invalid", () => {
34-
expect(tree().firstChild).toMatchSnapshot();
34+
expect(renderHelper().firstChild).toMatchSnapshot();
3535
});
3636

3737
it("renders the loading status if requesting data", () => {
3838
const reducer = { 1: { readyStatus: "request" } };
3939

40-
expect(tree(reducer).firstChild).toMatchSnapshot();
40+
expect(renderHelper(reducer).firstChild).toMatchSnapshot();
4141
});
4242

4343
it("renders an error if loading failed", () => {
4444
const reducer = { 1: { readyStatus: "failure" } };
4545

46-
expect(tree(reducer).firstChild).toMatchSnapshot();
46+
expect(renderHelper(reducer).firstChild).toMatchSnapshot();
4747
});
4848

4949
it("renders the <UserCard /> if loading was successful", () => {
@@ -59,6 +59,6 @@ describe("<UserInfo />", () => {
5959
},
6060
};
6161

62-
expect(tree(reducer).firstChild).toMatchSnapshot();
62+
expect(renderHelper(reducer).firstChild).toMatchSnapshot();
6363
});
6464
});

0 commit comments

Comments
 (0)