-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Upgrade Jest website to Docusaurus v3 #14463
Changes from 6 commits
b5b65c2
7d3765b
1ce379a
84ff24b
c306ec5
a1be1c1
1d52d8b
b547523
492ef9d
9c6517b
01f9983
ad898d7
2e2b1cb
8cee3d1
e06ede1
8642e45
e393b3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -243,7 +243,8 @@ This option requires `collectCoverage` to be set to `true` or Jest to be invoked | |
|
||
<details> | ||
<summary>Help:</summary> | ||
If you are seeing coverage output such as... | ||
|
||
If you are seeing coverage output such as... | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In MDX v2 not having a line break will wrap the summary in an extra useless paragraph. This leads browsers to ignore the nested summary tag and display the default label instead of the provided one. CF problem reported by Argos here: https://app.argos-ci.com/slorber/jest-website-visual-tests/builds/11/56882867 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change can be moved to a preparation PR and would work with both MDX v1 and v2 |
||
|
||
``` | ||
=============================== Coverage summary =============================== | ||
|
@@ -1753,7 +1754,7 @@ test('does not show prototypes for object and array inline', () => { | |
|
||
Default: `undefined` | ||
|
||
The path to a module that can resolve test<->snapshot path. This config option lets you customize where Jest stores snapshot files on disk. | ||
The path to a module that can resolve test<->snapshot path. This config option lets you customize where Jest stores snapshot files on disk. | ||
slorber marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```js title="custom-resolver.js" | ||
module.exports = { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,7 +89,8 @@ module.exports = { | |
|
||
The ideal configuration for Babel will depend on your project. See [Babel's docs](https://babeljs.io/docs/en/) for more details. | ||
|
||
<details><summary markdown="span"><strong>Making your Babel config jest-aware</strong></summary> | ||
<details> | ||
<summary markdown="span"><strong>Making your Babel config jest-aware</strong></summary> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In MDX v2 this does not compile. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change can be moved to a preparation PR and would work with both MDX v1 and v2 |
||
|
||
Jest will set `process.env.NODE_ENV` to `'test'` if it's not set to something else. You can use that in your configuration to conditionally setup only the compilation needed for Jest, e.g. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,7 +120,7 @@ Clears all information stored in the [`mockFn.mock.calls`](#mockfnmockcalls), [` | |
|
||
The [`clearMocks`](configuration#clearmocks-boolean) configuration option is available to clear mocks automatically before each tests. | ||
|
||
:::warning | ||
:::danger | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Issue reported by Argos due to default label change: https://app.argos-ci.com/slorber/jest-website-visual-tests/builds/11/56882879 Using Note: we are going to reintroduce There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we wanted this to be yellow. That doesn't currently exist? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The yellow admonition is currently I'd suggest to change that in another PR: the goal of this PR is to focus on having no regression and not improving things ;) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change can be moved to a preparation PR and would work with both MDX v1 and v2 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yellow is better!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. landed that yesterday #14493 |
||
|
||
Beware that `mockFn.mockClear()` will replace `mockFn.mock`, not just reset the values of its properties! You should, therefore, avoid assigning `mockFn.mock` to other variables, temporary or not, to make sure you don't access stale data. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,25 +32,25 @@ | |
] | ||
}, | ||
"dependencies": { | ||
"@docusaurus/core": "^2.0.0", | ||
"@docusaurus/plugin-client-redirects": "^2.0.0", | ||
"@docusaurus/plugin-pwa": "^2.0.0", | ||
"@docusaurus/preset-classic": "^2.0.0", | ||
"@docusaurus/remark-plugin-npm2yarn": "^2.0.0", | ||
"@docusaurus/core": "0.0.0-5658", | ||
"@docusaurus/plugin-client-redirects": "0.0.0-5658", | ||
"@docusaurus/plugin-pwa": "0.0.0-5658", | ||
"@docusaurus/preset-classic": "0.0.0-5658", | ||
"@docusaurus/remark-plugin-npm2yarn": "0.0.0-5658", | ||
"clsx": "^2.0.0", | ||
"docusaurus-remark-plugin-tab-blocks": "^1.2.0", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"docusaurus-remark-plugin-tab-blocks": "^2.0.0-beta", | ||
"react": "^18.2.0", | ||
"react-dom": "^18.2.0", | ||
"react-github-btn": "^1.3.0", | ||
"react-lite-youtube-embed": "^2.2.2", | ||
"react-markdown": "^8.0.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.11.6", | ||
"@crowdin/cli": "^3.5.2", | ||
"@docusaurus/module-type-aliases": "^2.0.0", | ||
"@docusaurus/module-type-aliases": "0.0.0-5658", | ||
"@tsconfig/docusaurus": "^1.0.5", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe bump this as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you mean? bump to what value? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. v2 has been released There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ??? but it's a Docusaurus dependency, we want it to be v3 (canary) like the other docusaurus dependencies. All official Docusaurus deps should use the exact same versions. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh! thought you were talking about the module above. Actually you are right I forgot something, we are using a new official package There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. just remove it based on tsconfig/bases#196? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
👍 |
||
"@types/react": "^17.0.3", | ||
"@types/react": "^18.2.21", | ||
"graphql": "^16.3.0", | ||
"graphql-request": "^6.0.0", | ||
"js-yaml": "^4.1.0", | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In MDX v2 this does not compile.
This is the readme though so not a big deal but I updated it too because mdx docs have the exact same content.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change can be moved to a preparation PR and would work with both MDX v1 and v2