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
*`[jest-cli]``jest --onlyChanged --changedFilesWithAncestor` now also works
8
10
with git. ([#5189](https://github.com/facebook/jest/pull/5189))
9
11
*`[jest-config]` fix unexpected condition to avoid infinite recursion in
10
12
Windows platform. ([#5161](https://github.com/facebook/jest/pull/5161))
11
-
*`[jest-config]` Escape parentheses and other glob characters in `rootDir` before interpolating with `testMatch`. ([#4838](https://github.com/facebook/jest/issues/4838))
13
+
*`[jest-config]` Escape parentheses and other glob characters in `rootDir`
Copy file name to clipboardExpand all lines: docs/JestObjectAPI.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -420,15 +420,19 @@ test('plays video', () => {
420
420
```
421
421
422
422
### `jest.spyOn(object, methodName, accessType?)`
423
-
##### available in Jest **x.x.x+**
424
423
425
-
Since Jest x.x.x+, the `jest.spyOn` method takes an optional third argument that can be `'get'` or `'get'` in order to install a spy as a getter or a setter respectively. This is also needed when you need a spy an existing getter/setter method.
424
+
##### available in Jest **22.1.0+**
425
+
426
+
Since Jest 22.1.0+, the `jest.spyOn` method takes an optional third argument of
427
+
`accessType` that can be either `'get'` or `'set'`, which proves to be useful
428
+
when you want to spy on a getter or a setter, respectively.
### Order of execution of describe and test blocks
151
151
152
-
Jest executes all describe handlers in a test file *before* it executes any of the actual tests. This is another reason to do setup and teardown in `before*` and `after*` handlers rather in the describe blocks. Once the describe blocks are complete, by default Jest runs all the tests serially in the order they were encountered in the collection phase, waiting for each to finish and be tidied up before moving on.
152
+
Jest executes all describe handlers in a test file _before_ it executes any of
153
+
the actual tests. This is another reason to do setup and teardown in `before*`
154
+
and `after*` handlers rather in the describe blocks. Once the describe blocks
155
+
are complete, by default Jest runs all the tests serially in the order they were
156
+
encountered in the collection phase, waiting for each to finish and be tidied up
157
+
before moving on.
153
158
154
159
Consider the following illustrative test file and output:
0 commit comments