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
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+8-18Lines changed: 8 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,7 @@ _Before_ submitting a pull request, please make sure the following is done…
34
34
35
35
Note: Replace `<your_username>` with your GitHub username
36
36
37
-
1. Jest uses [Yarn](https://code.facebook.com/posts/1840075619545360) for running development scripts. If you haven't already done so, please [install yarn](https://yarnpkg.com/en/docs/install).
37
+
1. Jest uses [Yarn](https://yarnpkg.com/) for running development scripts. If you haven't already done so, please run [`corepack enable`](https://nodejs.org/api/corepack.html#workflows).
38
38
39
39
1. Make sure you have `python` installed. Python is required by [node-gyp](https://github.com/nodejs/node-gyp) that is used when running `yarn install`.
40
40
@@ -44,13 +44,13 @@ _Before_ submitting a pull request, please make sure the following is done…
44
44
python --version
45
45
```
46
46
47
-
1. Make sure you have a compatible version of `node` installed (As of October 29th, 2021, `v16.x` is recommended).
47
+
1. Make sure you have a compatible version of `node` installed (As of November 15th, 2023, `v20.x` is recommended).
48
48
49
49
```sh
50
50
node -v
51
51
```
52
52
53
-
1. Run `yarn install`. On Windows: To install [Yarn](https://yarnpkg.com/en/docs/install#windows-tab) on Windows you may need to download either node.js or Chocolatey<br />
53
+
1. Run `yarn install`.
54
54
55
55
```sh
56
56
yarn install
@@ -62,12 +62,6 @@ _Before_ submitting a pull request, please make sure the following is done…
62
62
yarn --version
63
63
```
64
64
65
-
On Windows `yarn install` may fail with `gyp ERR! build error`. One of the possible solutions:
66
-
67
-
```sh
68
-
yarn global add windows-build-tools
69
-
```
70
-
71
65
1. Run `yarn build` to transpile TypeScript to JavaScript and type check the code
72
66
73
67
```sh
@@ -90,8 +84,6 @@ _Before_ submitting a pull request, please make sure the following is done…
90
84
$ yarn test
91
85
```
92
86
93
-
1. If you haven't already, complete the [CLA](https://code.facebook.com/cla/).
94
-
95
87
#### Changelog entries
96
88
97
89
All changes that add a feature to or fix a bug in any of Jest's packages require a changelog entry containing the names of the packages affected, a description of the change, and the number of and link to the pull request. Try to match the structure of the existing entries.
@@ -108,7 +100,7 @@ Code that is written needs to be tested to ensure that it achieves the desired b
108
100
109
101
##### Unit tests
110
102
111
-
Some of the packages within jest have a `__tests__` directory. This is where unit tests reside in. If the scope of your work only requires a unit test, this is where you will write it in. Tests here usually don't require much of any setup.
103
+
Some of the packages within Jest have a `__tests__` directory. This is where unit tests reside in. If the scope of your work only requires a unit test, this is where you will write it in. Tests here usually don't require much of any setup.
112
104
113
105
##### Integration tests
114
106
@@ -118,7 +110,7 @@ It is possible to run the integration test itself manually to inspect that the n
118
110
119
111
```bash
120
112
$ cd e2e/clear-cache
121
-
$ node ../../packages/jest-cli/bin/jest.js # It is possible to use node --inspect or ndb
113
+
$ node ../../packages/jest-cli/bin/jest.js # It is possible to use `node --inspect`
122
114
PASS __tests__/clear_cache.test.js
123
115
✓ stub (3ms)
124
116
@@ -166,9 +158,7 @@ The Jest website also offers documentation for older versions of Jest, which you
166
158
167
159
### Contributor License Agreement (CLA)
168
160
169
-
In order to accept your pull request, we need you to submit a CLA. You only need to do this once, so if you've done this for another Facebook open source project, you're good to go. If you are submitting a pull request for the first time, just let us know that you have completed the CLA and we can cross-check with your GitHub username.
170
-
171
-
[Complete your CLA here.](https://code.facebook.com/cla)
161
+
In order to accept your pull request, we need you to submit a CLA. You only need to do this once, so if you've done this for another OpenJS open source project, you're good to go. If you are submitting a pull request for the first time, a bot will verify and guide you on how to sign it.
172
162
173
163
## How to try a development build of Jest in another project
174
164
@@ -180,10 +170,10 @@ $ cd /path/to/your/Jest_clone
180
170
# Do one of the following:
181
171
182
172
# Check out a commit from another contributor, and then
183
-
$ yarn run build
173
+
$ yarn run watch
184
174
185
175
# Or, save your changes to Jest, and then
186
-
$ yarn test# which also builds Jest
176
+
$ yarn test
187
177
```
188
178
189
179
To run tests in another project with the development build of Jest:
0 commit comments