Skip to content

Commit 9ba62ad

Browse files
sunnyclimber456SimenB
authored andcommitted
Fix image URLs (#7872)
1 parent 1df98cb commit 9ba62ad

3 files changed

Lines changed: 11 additions & 12 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
- `[jest-mock]`: Migrate to TypeScript ([#7847](https://github.com/facebook/jest/pull/7847), [#7850](https://github.com/facebook/jest/pull/7850))
2929
- `[jest-worker]`: Migrate to TypeScript ([#7853](https://github.com/facebook/jest/pull/7853))
3030
- `[jest-haste-map]`: Migrate to TypeScript ([#7854](https://github.com/facebook/jest/pull/7854))
31+
- `[docs]`: Fix image paths in SnapshotTesting.md for current and version 24 ([#7872](https://github.com/facebook/jest/pull/7872))
3132

3233
### Performance
3334

docs/SnapshotTesting.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ exports[`renders correctly 1`] = `
4141

4242
The snapshot artifact should be committed alongside code changes, and reviewed as part of your code review process. Jest uses [pretty-format](https://github.com/facebook/jest/tree/master/packages/pretty-format) to make snapshots human-readable during code review. On subsequent test runs Jest will simply compare the rendered output with the previous snapshot. If they match, the test will pass. If they don't match, either the test runner found a bug in your code (in this case, it's `<Link>` component) that should be fixed, or the implementation has changed and the snapshot needs to be updated.
4343

44-
> Note: The snapshot is directly scoped to the data you render – in our example it's `<Link />` component with page prop passed to it. This implies that even if any other file has missing props (Say, `App.js`) in the `<Link />` component, it will still pass the test as the test doesn't know the usage of `<Link />` component and it's scoped only to the `Link.react.js`.
45-
> Also, Rendering the same component with different props in other snapshot tests will not affect the first one, as the tests don't know about each other.
44+
> Note: The snapshot is directly scoped to the data you render – in our example it's `<Link />` component with page prop passed to it. This implies that even if any other file has missing props (Say, `App.js`) in the `<Link />` component, it will still pass the test as the test doesn't know the usage of `<Link />` component and it's scoped only to the `Link.react.js`. Also, Rendering the same component with different props in other snapshot tests will not affect the first one, as the tests don't know about each other.
4645
4746
More information on how snapshot testing works and why we built it can be found on the [release blog post](https://jestjs.io/blog/2016/07/27/jest-14.html). We recommend reading [this blog post](http://benmccormick.org/2016/09/19/testing-with-jest-snapshots-first-impressions/) to get a good sense of when you should use snapshot testing. We also recommend watching this [egghead video](https://egghead.io/lessons/javascript-use-jest-s-snapshot-testing-feature?pl=testing-javascript-with-jest-a36c4074) on Snapshot Testing with Jest.
4847

@@ -64,7 +63,7 @@ it('renders correctly', () => {
6463

6564
In that case, Jest will print this output:
6665

67-
![](/website/static/img/content/failedSnapshotTest.png)
66+
![](/img/content/failedSnapshotTest.png)
6867

6968
Since we just updated our component to point to a different address, it's reasonable to expect changes in the snapshot for this component. Our snapshot test case is failing because the snapshot for our updated component no longer matches the snapshot artifact for this test case.
7069

@@ -84,17 +83,17 @@ You can try out this functionality by cloning the [snapshot example](https://git
8483

8584
Failed snapshots can also be updated interactively in watch mode:
8685

87-
![](/website/static/img/content/interactiveSnapshot.png)
86+
![](/img/content/interactiveSnapshot.png)
8887

8988
Once you enter Interactive Snapshot Mode, Jest will step you through the failed snapshots one test at a time and give you the opportunity to review the failed output.
9089

9190
From here you can choose to update that snapshot or skip to the next:
9291

93-
![](/website/static/img/content/interactiveSnapshotUpdate.gif)
92+
![](/img/content/interactiveSnapshotUpdate.gif)
9493

9594
Once you're finished, Jest will give you a summary before returning back to watch mode:
9695

97-
![](/website/static/img/content/interactiveSnapshotDone.png)
96+
![](/img/content/interactiveSnapshotDone.png)
9897

9998
### Inline Snapshots
10099

website/versioned_docs/version-24.0/SnapshotTesting.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ exports[`renders correctly 1`] = `
4242

4343
The snapshot artifact should be committed alongside code changes, and reviewed as part of your code review process. Jest uses [pretty-format](https://github.com/facebook/jest/tree/master/packages/pretty-format) to make snapshots human-readable during code review. On subsequent test runs Jest will simply compare the rendered output with the previous snapshot. If they match, the test will pass. If they don't match, either the test runner found a bug in your code (in this case, it's `<Link>` component) that should be fixed, or the implementation has changed and the snapshot needs to be updated.
4444

45-
> Note: The snapshot is directly scoped to the data you render – in our example it's `<Link />` component with page prop passed to it. This implies that even if any other file has missing props (Say, `App.js`) in the `<Link />` component, it will still pass the test as the test doesn't know the usage of `<Link />` component and it's scoped only to the `Link.react.js`.
46-
> Also, Rendering the same component with different props in other snapshot tests will not affect the first one, as the tests don't know about each other.
45+
> Note: The snapshot is directly scoped to the data you render – in our example it's `<Link />` component with page prop passed to it. This implies that even if any other file has missing props (Say, `App.js`) in the `<Link />` component, it will still pass the test as the test doesn't know the usage of `<Link />` component and it's scoped only to the `Link.react.js`. Also, Rendering the same component with different props in other snapshot tests will not affect the first one, as the tests don't know about each other.
4746
4847
More information on how snapshot testing works and why we built it can be found on the [release blog post](https://jestjs.io/blog/2016/07/27/jest-14.html). We recommend reading [this blog post](http://benmccormick.org/2016/09/19/testing-with-jest-snapshots-first-impressions/) to get a good sense of when you should use snapshot testing. We also recommend watching this [egghead video](https://egghead.io/lessons/javascript-use-jest-s-snapshot-testing-feature?pl=testing-javascript-with-jest-a36c4074) on Snapshot Testing with Jest.
4948

@@ -65,7 +64,7 @@ it('renders correctly', () => {
6564

6665
In that case, Jest will print this output:
6766

68-
![](/website/static/img/content/failedSnapshotTest.png)
67+
![](/img/content/failedSnapshotTest.png)
6968

7069
Since we just updated our component to point to a different address, it's reasonable to expect changes in the snapshot for this component. Our snapshot test case is failing because the snapshot for our updated component no longer matches the snapshot artifact for this test case.
7170

@@ -85,17 +84,17 @@ You can try out this functionality by cloning the [snapshot example](https://git
8584

8685
Failed snapshots can also be updated interactively in watch mode:
8786

88-
![](/website/static/img/content/interactiveSnapshot.png)
87+
![](/img/content/interactiveSnapshot.png)
8988

9089
Once you enter Interactive Snapshot Mode, Jest will step you through the failed snapshots one test at a time and give you the opportunity to review the failed output.
9190

9291
From here you can choose to update that snapshot or skip to the next:
9392

94-
![](/website/static/img/content/interactiveSnapshotUpdate.gif)
93+
![](/img/content/interactiveSnapshotUpdate.gif)
9594

9695
Once you're finished, Jest will give you a summary before returning back to watch mode:
9796

98-
![](/website/static/img/content/interactiveSnapshotDone.png)
97+
![](/img/content/interactiveSnapshotDone.png)
9998

10099
### Inline Snapshots
101100

0 commit comments

Comments
 (0)