Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update jest #1263

Merged
merged 8 commits into from
Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ rules:
- error
- env: literal
'jest/expect-expect': 'off'
'testing-library/prefer-expect-query-by': 'error'
settings:
react:
version: 'detect'
Expand Down
2 changes: 1 addition & 1 deletion application-templates/starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,6 @@
"@commercetools-frontend/mc-scripts": "15.8.0",
"@testing-library/react": "9.4.0",
"enzyme": "3.11.0",
"jest": "24.9.0"
"jest": "25.1.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider this a breaking change? Cause the jest peer dep also needs to be bumped.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for raising. I think to me it's not a breaking change. Only node 6 support is dropped and we require node 10/12 in other cases already. All other breaking changes I see are dependent to how people use jest within our peer dependency range. So if somebody imported from @jest/core or jest-cli and that now changed is not something we can make guarantees about. If their remain to have 24 installed nothing would break for them in anyway. Do you agree or have other concerns about this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah if we support both version it should be fine like this. Let's maybe mention it in the changelog that people can start using jest 25.

}
}
1 change: 0 additions & 1 deletion jest.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ declare namespace jest {
toRender(component: React.ComponentType): R;
toHaveState(selector: string, expected: unknown): R;
// The following matchers are part of https://www.npmjs.com/package/jest-dom
toBeInTheDocument: () => R;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now comes for free as far as I can tell.

CleanShot 2020-01-22 at 18 17 39@2x

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, good to know!

toHaveText(selector: string): R;
}
}
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@
]
},
"devDependencies": {
"@commercetools/github-labels": "1.1.0",
"@commercetools-docs/writing-style": "1.0.3",
"@commercetools-uikit/design-system": "10.13.0",
"@commercetools/github-labels": "1.1.0",
"@commitlint/cli": "8.3.5",
"@commitlint/config-conventional": "8.3.4",
"@graphql-codegen/add": "1.11.2",
Expand All @@ -93,16 +93,16 @@
"@types/node": "12.12.25",
"@types/node-fetch": "2.5.4",
"@types/prop-types": "15.7.3",
"@types/react": "16.9.17",
"@types/react-dom": "16.9.4",
"@types/react": "16.9.18",
"@types/react-dom": "16.9.5",
"@types/react-modal": "3.10.4",
"@types/react-redux": "7.1.6",
"@types/react-router": "5.1.4",
"@types/react-router-dom": "5.1.3",
"@types/webpack": "4.41.2",
"@types/webpack": "4.41.3",
"@types/webpack-env": "1.15.0",
"@typescript-eslint/eslint-plugin": "2.16.0",
"@typescript-eslint/parser": "2.16.0",
"@typescript-eslint/eslint-plugin": "2.17.0",
"@typescript-eslint/parser": "2.17.0",
"apollo-server-errors": "2.3.4",
"babel-eslint": "10.0.3",
"babel-plugin-import-graphql": "2.7.0",
Expand All @@ -128,14 +128,13 @@
"eslint-plugin-prettier": "3.1.2",
"eslint-plugin-react": "7.18.0",
"eslint-plugin-react-hooks": "2.3.0",
"eslint-plugin-testing-library": "1.4.1",
"eslint-plugin-testing-library": "1.5.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot to do it last time, we need to explicitly enable prefer-expect-query-by now, as it does not come enabled by default anymore: https://github.com/testing-library/eslint-plugin-testing-library/releases/tag/v1.4.1

More on the reasons here: testing-library/eslint-plugin-testing-library#59

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI: we're replacing that rule with a new one, targeted only for cases when you want to assert that an element is not in the document.

testing-library/eslint-plugin-testing-library#65

Copy link
Contributor Author

@tdeekens tdeekens Jan 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good to now. Thanks for sharing 76c8b70.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, interesting. Read up on the background now. Makes sense what's in store there :)

"faker": "4.1.0",
"gatsby-plugin-emotion": "4.1.21",
"graphql-cli": "3.0.14",
"husky": "4.0.10",
"xhr-mock": "2.5.1",
"jest": "24.9.0",
"jest-each": "24.9.0",
"husky": "4.2.0",
"jest": "25.1.0",
"jest-each": "25.1.0",
"jest-puppeteer": "4.4.0",
"jest-runner-eslint": "0.7.5",
"jest-runner-executor": "1.0.0",
Expand All @@ -144,7 +143,7 @@
"jest-watch-typeahead": "0.4.2",
"lerna": "3.20.2",
"lerna-changelog": "1.0.0",
"lint-staged": "10.0.0",
"lint-staged": "10.0.2",
"mri": "1.1.4",
"postcss": "7.0.26",
"postcss-custom-properties": "9.0.2",
Expand All @@ -154,28 +153,29 @@
"rcfile": "1.0.3",
"read-pkg-up": "7.0.1",
"replace": "1.1.5",
"rollup": "1.29.0",
"rollup": "1.29.1",
"rollup-plugin-babel": "4.3.3",
"rollup-plugin-commonjs": "10.1.0",
"rollup-plugin-node-builtins": "2.1.2",
"rollup-plugin-node-resolve": "5.2.0",
"rollup-plugin-peer-deps-external": "2.2.0",
"rollup-plugin-postcss": "2.0.3",
"rollup-plugin-postcss": "2.0.4",
"rosie": "2.0.1",
"shelljs": "0.8.3",
"start-server-and-test": "1.10.6",
"start-server-and-test": "1.10.7",
"stylelint": "13.0.0",
"stylelint-config-prettier": "8.0.1",
"stylelint-config-standard": "19.0.0",
"stylelint-order": "4.0.0",
"stylelint-value-no-unknown-custom-properties": "2.0.0",
"typescript": "3.7.5",
"vfile-message": "2.0.2"
"vfile-message": "2.0.2",
"xhr-mock": "2.5.1"
},
"resolutions": {
"@commercetools-frontend/ui-kit": "10.13.0",
"**/@commercetools-frontend/ui-kit": "10.13.0",
"@types/react": "16.9.17",
"@types/react": "16.9.18",
"@types/react-router": "5.1.4",
"react": "16.12.0",
"**/react": "16.12.0",
Expand All @@ -189,4 +189,4 @@
"npm": ">=5",
"yarn": ">=1.10"
}
}
}
6 changes: 3 additions & 3 deletions packages/jest-preset-mc-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"@commercetools-frontend/babel-preset-mc-app": "15.8.0",
"@commercetools/enzyme-extensions": "5.0.0",
"@commercetools/jest-enzyme-matchers": "1.1.2",
"@testing-library/jest-dom": "5.0.0",
"babel-jest": "24.9.0",
"@testing-library/jest-dom": "5.0.2",
"babel-jest": "25.1.0",
"colors": "1.4.0",
"enzyme-adapter-react-16": "1.15.2",
"enzyme-matchers": "7.1.2",
Expand All @@ -51,6 +51,6 @@
"peerDependencies": {
"@testing-library/react": "9.x",
"enzyme": "3.x",
"jest": "24.x"
"jest": "24.x || 25.x"
}
}
6 changes: 3 additions & 3 deletions packages/mc-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
"@commercetools-frontend/babel-preset-mc-app": "15.8.0",
"@commercetools-frontend/mc-dev-authentication": "15.6.0",
"@commercetools-frontend/mc-html-template": "15.6.0",
"@svgr/webpack": "5.0.1",
"@svgr/webpack": "5.1.0",
"babel-loader": "8.0.6",
"babel-plugin-react-intl": "5.1.16",
"browserslist": "4.8.3",
"babel-plugin-react-intl": "5.1.17",
"browserslist": "4.8.5",
"clean-webpack-plugin": "3.0.0",
"core-js": "3.6.4",
"css-loader": "3.4.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@commercetools/http-user-agent": "2.1.2",
"@commercetools/sdk-client": "2.1.1",
"@commercetools/sdk-middleware-correlation-id": "2.1.1",
"@commercetools/sdk-middleware-http": "6.0.3",
"@commercetools/sdk-middleware-http": "6.0.4",
"fast-equals": "2.0.0",
"prop-types": "15.7.2",
"qss": "2.0.3",
Expand Down
2 changes: 1 addition & 1 deletion website-components-playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"@emotion/styled": "10.0.27",
"core-js": "3.6.4",
"formik": "2.1.2",
"gatsby": "2.18.25",
"gatsby": "2.19.1",
"gatsby-cli": "2.8.27",
"gatsby-plugin-emotion": "4.1.21",
"gatsby-plugin-prefetch-google-fonts": "1.4.3",
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@commercetools-uikit/spacings-stack": "10.13.0",
"@emotion/core": "10.0.27",
"@emotion/styled": "10.0.27",
"gatsby": "2.18.25",
"gatsby": "2.19.1",
"gatsby-cli": "2.8.27",
"react": "16.12.0",
"react-dom": "16.12.0",
Expand Down
Loading