You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please note this issue tracker is not a help forum. We recommend using [StackOverflow](https://stackoverflow.com/questions/tagged/jest) or our [discord channel](https://discord.gg/MWRhKCj) for questions.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,19 @@
2
2
3
3
### Features
4
4
5
+
-`[jest-snapshot]` Introduce `toMatchInlineSnapshot` and `toThrowErrorMatchingInlineSnapshot` matchers ([#6380](https://github.com/facebook/jest/pull/6380))
6
+
7
+
### Chore & Maintenance
8
+
9
+
-`[website]` Switch domain to https://jestjs.io ([#6549](https://github.com/facebook/jest/pull/6549))
10
+
11
+
## 23.2.0
12
+
13
+
### Features
14
+
5
15
-`[jest-each]` Add support for keyPaths in test titles ([#6457](https://github.com/facebook/jest/pull/6457))
6
16
-`[jest-cli]` Add `jest --init` option that generates a basic configuration file with a short description for each option ([#6442](https://github.com/facebook/jest/pull/6442))
17
+
-`[jest.retryTimes]` Add `jest.retryTimes()` option that allows failed tests to be retried n-times when using jest-circus. ([#6498](https://github.com/facebook/jest/pull/6498))
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -153,6 +153,22 @@ Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
153
153
- Trailing commas,
154
154
- Avd abbr wrds.
155
155
156
+
## Credits
157
+
158
+
This project exists thanks to all the people who [contribute](CONTRIBUTING.md). <a href="graphs/contributors"><img src="https://opencollective.com/jest/contributors.svg?width=890&button=false" /></a>
**👩🏻💻 Developer Ready**: Complete and ready to set-up JavaScript testing solution. Works out of the box for any React project.
22
+
23
+
**🏃🏽 Instant Feedback**: Fast interactive watch mode runs only test files related to changed files and is optimized to give signal quickly.
24
+
25
+
**📸 Snapshot Testing**: Capture snapshots of React trees or other serializable values to simplify testing and to analyze how state changes over time.
12
26
13
27
## Getting Started
14
28
@@ -26,7 +40,7 @@ Or via [`npm`](https://www.npmjs.com/):
26
40
npm install --save-dev jest
27
41
```
28
42
29
-
The minimum supported Node version is `v6.0.0` by default. If you need to support Node 4, refer to the [Compatibility issues](https://facebook.github.io/jest/docs/en/troubleshooting.html#compatibility-issues) section.
43
+
The minimum supported Node version is `v6.0.0` by default. If you need to support Node 4, refer to the [Compatibility issues](https://jestjs.io/docs/en/troubleshooting#compatibility-issues) section.
30
44
31
45
Let's get started by writing a test for a hypothetical function that adds two numbers. First, create a `sum.js` file:
32
46
@@ -66,7 +80,7 @@ PASS ./sum.test.js
66
80
67
81
**You just successfully wrote your first test using Jest!**
68
82
69
-
This test used `expect` and `toBe` to test that two values were exactly identical. To learn about the other things that Jest can test, see [Using Matchers](https://facebook.github.io/jest/docs/using-matchers.html).
83
+
This test used `expect` and `toBe` to test that two values were exactly identical. To learn about the other things that Jest can test, see [Using Matchers](https://jestjs.io/docs/using-matchers).
70
84
71
85
## Running from command line
72
86
@@ -78,7 +92,7 @@ Here's how to run Jest on files matching `my-test`, using `config.json` as a con
78
92
jest my-test --notify --config=config.json
79
93
```
80
94
81
-
If you'd like to learn more about running `jest` through the command line, take a look at the [Jest CLI Options](https://facebook.github.io/jest/docs/cli.html) page.
95
+
If you'd like to learn more about running `jest` through the command line, take a look at the [Jest CLI Options](https://jestjs.io/docs/cli) page.
82
96
83
97
## Additional Configuration
84
98
@@ -92,7 +106,7 @@ If you'd like to learn more about running `jest` through the command line, take
Don't forget to add a [`.babelrc`](https://babeljs.io/docs/usage/babelrc/) file in your project's root folder. For example, if you are using ES6 and [React.js](https://facebook.github.io/react/) with the [`babel-preset-env`](https://babeljs.io/docs/plugins/preset-env/) and [`babel-preset-react`](https://babeljs.io/docs/plugins/preset-react/) presets:
109
+
Don't forget to add a [`.babelrc`](https://babeljs.io/docs/usage/babelrc/) file in your project's root folder. For example, if you are using ES6 and [React.js](https://reactjs.org) with the [`babel-preset-env`](https://babeljs.io/docs/plugins/preset-env/) and [`babel-preset-react`](https://babeljs.io/docs/plugins/preset-react/) presets:
96
110
97
111
```json
98
112
{
@@ -140,24 +154,24 @@ To use TypeScript in your tests you can use [ts-jest](https://github.com/kulshek
140
154
141
155
## Documentation
142
156
143
-
Learn more about using [Jest on the official site!](http://facebook.github.io/jest)
157
+
Learn more about using [Jest on the official site!](https://jestjs.io)
Show the world you're using _Jest_ → [](https://github.com/facebook/jest) [](https://github.com/facebook/jest)
166
+
Show the world you're using _Jest_ → [](https://github.com/facebook/jest) [](https://github.com/facebook/jest)
153
167
154
168
```md
155
-
[](https://github.com/facebook/jest) [](https://github.com/facebook/jest)
169
+
[](https://github.com/facebook/jest) [](https://github.com/facebook/jest)
156
170
```
157
171
158
172
## Contributing
159
173
160
-
The main purpose of this repository is to continue to evolve Jest, making it faster and easier to use. Development of Jest happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving Jest.
174
+
Development of Jest happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving Jest.
161
175
162
176
### [Code of Conduct](https://code.facebook.com/codeofconduct)
163
177
@@ -167,10 +181,26 @@ Facebook has adopted a Code of Conduct that we expect project participants to ad
167
181
168
182
Read our [contributing guide](CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to Jest.
169
183
170
-
### Good First Issues
184
+
### [Good First Issues](https://github.com/facebook/jest/labels/Good%20First%20Issue%20%3Awave%3A)
171
185
172
186
To help you get your feet wet and get you familiar with our contribution process, we have a list of [good first issues](https://github.com/facebook/jest/labels/Good%20First%20Issue%20%3Awave%3A) that contain bugs which have a relatively limited scope. This is a great place to get started.
173
187
174
-
### License
188
+
## Credits
189
+
190
+
This project exists thanks to all the people who [contribute](CONTRIBUTING.md). <a href="graphs/contributors"><img src="https://opencollective.com/jest/contributors.svg?width=890&button=false" /></a>
Ensures that a value matches the most recent snapshot. Unlike [`.toMatchSnapshot()`](#tomatchsnapshotpropertymatchers-snapshotname), the snapshots will be written to the current source file, inline.
1037
+
1038
+
Check out the section on [Inline Snapshots](./SnapshotTesting.md#inline-snapshots) for more info.
1039
+
1034
1040
### `.toStrictEqual(value)`
1035
1041
1036
1042
Use `.toStrictEqual` to test that objects have the same types as well as structure.
Check out [React Tree Snapshot Testing](http://facebook.github.io/jest/blog/2016/07/27/jest-14.html) for more information on snapshot testing.
1143
+
1144
+
### `.toThrowErrorMatchingInlineSnapshot()`
1145
+
1146
+
This matcher is much like [`.toThrowErrorMatchingSnapshot`](#tothrowerrormatchingsnapshot), except instead of writing the snapshot value to a `.snap` file, it will be written into the source code automatically.
1147
+
1148
+
Check out the section on [Inline Snapshots](./SnapshotTesting.md#inline-snapshots) for more info.
0 commit comments