File tree 1 file changed +9
-14
lines changed
packages/gatsby-cli/src/structured-errors/__tests__
1 file changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -2,21 +2,16 @@ import constructError from "../construct-error"
2
2
import { errorMap } from "../error-map"
3
3
import { Level } from "../types"
4
4
5
- let log
6
- let processExit
7
- beforeEach ( ( ) => {
8
- log = jest . spyOn ( console , `log` ) . mockImplementation ( ( ) => { } )
9
- processExit = (
10
- jest . spyOn ( process , `exit` ) as unknown as jest . Mock
11
- ) . mockImplementation ( ( ) => { } )
5
+ const processExit = (
6
+ jest . spyOn ( process , `exit` ) as unknown as jest . Mock
7
+ ) . mockImplementation ( ( ) => { } )
8
+ const log = (
9
+ jest . spyOn ( console , `log` ) as unknown as jest . Mock
10
+ ) . mockImplementation ( ( ) => { } )
12
11
13
- log . mockReset ( )
14
- processExit . mockReset ( )
15
- } )
16
-
17
- afterAll ( ( ) => {
18
- ; ( console . log as jest . Mock ) . mockClear ( )
19
- ; ( process . exit as unknown as jest . Mock ) . mockClear ( )
12
+ afterEach ( ( ) => {
13
+ log . mockClear ( )
14
+ processExit . mockClear ( )
20
15
} )
21
16
22
17
test ( `it exits on invalid error schema` , ( ) => {
You can’t perform that action at this time.
0 commit comments