File tree Expand file tree Collapse file tree 10 files changed +28
-38
lines changed
jest-haste-map/src/crawlers Expand file tree Collapse file tree 10 files changed +28
-38
lines changed Original file line number Diff line number Diff line change 74
74
- ` [jest-runner] ` : Migrate to TypeScript ([ #7968 ] ( https://github.com/facebook/jest/pull/7968 ) )
75
75
- ` [jest-runtime] ` : Migrate to TypeScript ([ #7964 ] ( https://github.com/facebook/jest/pull/7964 ) , [ #7988 ] ( https://github.com/facebook/jest/pull/7988 ) )
76
76
- ` [@jest/fake-timers] ` : Extract FakeTimers class from ` jest-util ` into a new separate package ([ #7987 ] ( https://github.com/facebook/jest/pull/7987 ) )
77
- - ` [@jest/reporters] ` : Migrate to TypeScript ([ #7994 ] ( https://github.com/facebook/jest/pull/7994 ) )
77
+ - ` [@jest/reporters] ` : Migrate to TypeScript ([ #7994 ] ( https://github.com/facebook/jest/pull/7994 ) , [ # 8045 ] ( https://github.com/facebook/jest/pull/8045 ) )
78
78
- ` [jest-repl] ` : Migrate to TypeScript ([ #8000 ] ( https://github.com/facebook/jest/pull/8000 ) )
79
79
- ` [jest-validate] ` : Migrate to TypeScript ([ #7991 ] ( https://github.com/facebook/jest/pull/7991 ) )
80
80
- ` [docs] ` : Update CONTRIBUTING.md to add information about running jest with ` jest-circus ` locally ([ #8013 ] ( https://github.com/facebook/jest/pull/8013 ) ).
Original file line number Diff line number Diff line change 8
8
import { dispatch } from './state' ;
9
9
import { GlobalErrorHandlers } from './types' ;
10
10
11
- type Process = NodeJS . Process ;
12
-
13
- const uncaught = ( error : Error ) => {
11
+ const uncaught : NodeJS . UncaughtExceptionListener &
12
+ NodeJS . UnhandledRejectionListener = ( error : unknown ) => {
14
13
dispatch ( { error, name : 'error' } ) ;
15
14
} ;
16
15
17
16
export const injectGlobalErrorHandlers = (
18
- parentProcess : Process ,
17
+ parentProcess : NodeJS . Process ,
19
18
) : GlobalErrorHandlers => {
20
19
const uncaughtException = process . listeners ( 'uncaughtException' ) . slice ( ) ;
21
20
const unhandledRejection = process . listeners ( 'unhandledRejection' ) . slice ( ) ;
@@ -27,7 +26,7 @@ export const injectGlobalErrorHandlers = (
27
26
} ;
28
27
29
28
export const restoreGlobalErrorHandlers = (
30
- parentProcess : Process ,
29
+ parentProcess : NodeJS . Process ,
31
30
originalErrorHandlers : GlobalErrorHandlers ,
32
31
) => {
33
32
parentProcess . removeListener ( 'uncaughtException' , uncaught ) ;
Original file line number Diff line number Diff line change 8
8
import { TestResult } from '@jest/types' ;
9
9
import { Test } from 'jest-runner' ;
10
10
import { Context } from 'jest-runtime' ;
11
- import { Reporter , ReporterOnStartOptions } from './types ' ;
11
+ import { Reporter , ReporterOnStartOptions } from '@jest/reporters ' ;
12
12
13
13
export default class ReporterDispatcher {
14
14
private _reporters : Array < Reporter > ;
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ import {
17
17
NotifyReporter ,
18
18
SummaryReporter ,
19
19
VerboseReporter ,
20
- // @ts -ignore: Not migrated to TS
20
+ Reporter ,
21
21
} from '@jest/reporters' ;
22
22
import exit from 'exit' ;
23
23
import {
@@ -28,7 +28,6 @@ import {
28
28
import ReporterDispatcher from './ReporterDispatcher' ;
29
29
import TestWatcher from './TestWatcher' ;
30
30
import { shouldRunInBand } from './testSchedulerHelper' ;
31
- import { Reporter } from './types' ;
32
31
33
32
// The default jest-runner is required because it is the default test runner
34
33
// and required implicitly through the `runner` ProjectConfig option.
Original file line number Diff line number Diff line change 7
7
8
8
import { Context } from 'jest-runtime' ;
9
9
import { Test } from 'jest-runner' ;
10
- import { Config , TestResult } from '@jest/types' ;
10
+ import { Config } from '@jest/types' ;
11
11
12
12
export type TestRunData = Array < {
13
13
context : Context ;
@@ -38,27 +38,3 @@ export type TestPathCases = {
38
38
export type TestPathCasesWithPathPattern = TestPathCases & {
39
39
testPathPattern : ( path : Config . Path ) => boolean ;
40
40
} ;
41
-
42
- // TODO: Obtain this from @jest /reporters once its been migrated
43
- export type ReporterOnStartOptions = {
44
- estimatedTime : number ;
45
- showStatus : boolean ;
46
- } ;
47
-
48
- export type Reporter = {
49
- onTestResult : (
50
- test : Test ,
51
- testResult : TestResult . TestResult ,
52
- aggregatedResult : TestResult . AggregatedResult ,
53
- ) => Promise < void > ;
54
- onRunStart : (
55
- results : TestResult . AggregatedResult ,
56
- options : ReporterOnStartOptions ,
57
- ) => Promise < void > ;
58
- onTestStart : ( test : Test ) => Promise < void > ;
59
- onRunComplete : (
60
- contexts : Set < Context > ,
61
- results : TestResult . AggregatedResult ,
62
- ) => Promise < void > ;
63
- getLastError : ( ) => Error ;
64
- } ;
Original file line number Diff line number Diff line change 4
4
"rootDir" : " src" ,
5
5
"outDir" : " build"
6
6
},
7
- // TODO: This is missing `@jest/reporters`
8
7
"references" : [
9
8
{"path" : " ../jest-changed-files" },
10
9
{"path" : " ../jest-config" },
11
10
{"path" : " ../jest-console" },
12
11
{"path" : " ../jest-haste-map" },
13
12
{"path" : " ../jest-message-util" },
14
13
{"path" : " ../jest-regex-util" },
14
+ {"path" : " ../jest-reporters" },
15
15
{"path" : " ../jest-resolve-dependencies" },
16
16
{"path" : " ../jest-runner" },
17
17
{"path" : " ../jest-runtime" },
Original file line number Diff line number Diff line change @@ -96,6 +96,11 @@ function findNative(
96
96
97
97
const child = spawn ( 'find' , args ) ;
98
98
let stdout = '' ;
99
+ if ( child . stdout === null ) {
100
+ throw new Error (
101
+ 'stdout is null - this should never happen. Please open up an issue at https://github.com/facebook/jest' ,
102
+ ) ;
103
+ }
99
104
child . stdout . setEncoding ( 'utf-8' ) ;
100
105
child . stdout . on ( 'data' , data => ( stdout += data ) ) ;
101
106
Original file line number Diff line number Diff line change @@ -11,3 +11,4 @@ export {default as DefaultReporter} from './default_reporter';
11
11
export { default as NotifyReporter } from './notify_reporter' ;
12
12
export { default as SummaryReporter } from './summary_reporter' ;
13
13
export { default as VerboseReporter } from './verbose_reporter' ;
14
+ export { Reporter , ReporterOnStartOptions } from './types' ;
Original file line number Diff line number Diff line change @@ -158,10 +158,20 @@ export default class ChildProcessWorker implements WorkerInterface {
158
158
}
159
159
160
160
getStdout ( ) : NodeJS . ReadableStream {
161
+ if ( this . _child . stdout === null ) {
162
+ throw new Error (
163
+ 'stdout is null - this should never happen. Please open up an issue at https://github.com/facebook/jest' ,
164
+ ) ;
165
+ }
161
166
return this . _child . stdout ;
162
167
}
163
168
164
169
getStderr ( ) : NodeJS . ReadableStream {
170
+ if ( this . _child . stderr === null ) {
171
+ throw new Error (
172
+ 'stderr is null - this should never happen. Please open up an issue at https://github.com/facebook/jest' ,
173
+ ) ;
174
+ }
165
175
return this . _child . stderr ;
166
176
}
167
177
}
Original file line number Diff line number Diff line change 1733
1733
integrity sha512-bNtBj6AF1F90jp54KRPOrYfilGNfPr2kpaUN7rMJjauAtfGBXzT/T/REZN6jb4qUs9FTxU37kir3Nrn5WsTUDw==
1734
1734
1735
1735
"@types/node@*", "@types/node@^11.9.6":
1736
- version "11.9.6 "
1737
- resolved "https://registry.yarnpkg.com/@types/node/-/node-11.9.6 .tgz#c632bbcc780a1349673a6e2e9b9dfa8c369d3c74 "
1738
- integrity sha512-4hS2K4gwo9/aXIcoYxCtHpdgd8XUeDmo1siRCAH3RziXB65JlPqUFMtfy9VPj+og7dp3w1TFjGwYga4e0m9GwA ==
1736
+ version "11.10.4 "
1737
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-11.10.4 .tgz#3f5fc4f0f322805f009e00ab35a2ff3d6b778e42 "
1738
+ integrity sha512-wa09itaLE8L705aXd8F80jnFpxz3Y1/KRHfKsYL2bPc0XF+wEWu8sR9n5bmeu8Ba1N9z2GRNzm/YdHcghLkLKg ==
1739
1739
1740
1740
"@types/p-each-series@^1.0.0":
1741
1741
version "1.0.0"
You can’t perform that action at this time.
0 commit comments