File tree Expand file tree Collapse file tree 20 files changed +18
-30
lines changed
e2e/transform/transform-runner Expand file tree Collapse file tree 20 files changed +18
-30
lines changed Original file line number Diff line number Diff line change 17
17
- ` [jest-cli, jest-core] ` Add ` --ignoreProjects ` CLI argument to ignore test suites by project name ([ #12620 ] ( https://github.com/facebook/jest/pull/12620 ) )
18
18
- ` [jest-core] ` Pass project config to ` globalSetup ` /` globalTeardown ` function as second argument ([ #12440 ] ( https://github.com/facebook/jest/pull/12440 ) )
19
19
- ` [jest-core] ` Stabilize test runners with event emitters ([ #12641 ] ( https://github.com/facebook/jest/pull/12641 ) )
20
+ - ` [jest-core, jest-watcher] ` [ ** BREAKING** ] Move ` TestWatcher ` class to ` jest-watcher ` package ([ #12652 ] ( https://github.com/facebook/jest/pull/12652 ) )
20
21
- ` [jest-environment-jsdom] ` [ ** BREAKING** ] Upgrade jsdom to 19.0.0 ([ #12290 ] ( https://github.com/facebook/jest/pull/12290 ) )
21
22
- ` [jest-environment-jsdom] ` [ ** BREAKING** ] Add default ` browser ` condition to ` exportConditions ` for ` jsdom ` environment ([ #11924 ] ( https://github.com/facebook/jest/pull/11924 ) )
22
23
- ` [jest-environment-jsdom] ` [ ** BREAKING** ] Pass global config to Jest environment constructor for ` jsdom ` environment ([ #12461 ] ( https://github.com/facebook/jest/pull/12461 ) )
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ import type {
13
13
OnTestStart ,
14
14
OnTestSuccess ,
15
15
TestRunnerContext ,
16
- TestWatcher ,
17
16
} from 'jest-runner' ;
17
+ import type { TestWatcher } from 'jest-watcher' ;
18
18
19
19
export default class BaseTestRunner {
20
20
private _globalConfig : Config . GlobalConfig ;
Original file line number Diff line number Diff line change 20
20
"@types/node" : " *" ,
21
21
"ansi-escapes" : " ^4.2.1" ,
22
22
"chalk" : " ^4.0.0" ,
23
- "emittery" : " ^0.10.2" ,
24
23
"exit" : " ^0.1.2" ,
25
24
"graceful-fs" : " ^4.2.9" ,
26
25
"jest-changed-files" : " ^28.0.0-alpha.3" ,
Original file line number Diff line number Diff line change @@ -36,8 +36,8 @@ import {
36
36
cleanup as cleanupSnapshots ,
37
37
} from 'jest-snapshot' ;
38
38
import { requireOrImportModule } from 'jest-util' ;
39
+ import type { TestWatcher } from 'jest-watcher' ;
39
40
import ReporterDispatcher from './ReporterDispatcher' ;
40
- import type TestWatcher from './TestWatcher' ;
41
41
import { shouldRunInBand } from './testSchedulerHelper' ;
42
42
43
43
type TestRunnerConstructor = new (
Original file line number Diff line number Diff line change 7
7
*/
8
8
9
9
import chalk from 'chalk' ;
10
- import { JestHook , KEYS } from 'jest-watcher' ;
11
10
// eslint-disable-next-line import/order
12
- import TestWatcher from '../TestWatcher ' ;
11
+ import { JestHook , KEYS , TestWatcher } from 'jest-watcher ' ;
13
12
14
13
const runJestMock = jest . fn ( ) ;
15
14
const watchPluginPath = `${ __dirname } /__fixtures__/watchPlugin` ;
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ import {readConfigs} from 'jest-config';
16
16
import type HasteMap from 'jest-haste-map' ;
17
17
import Runtime , { Context } from 'jest-runtime' ;
18
18
import { createDirectory , preRunMessage } from 'jest-util' ;
19
- import TestWatcher from '../TestWatcher ' ;
19
+ import { TestWatcher } from 'jest-watcher ' ;
20
20
import { formatHandleErrors } from '../collectHandles' ;
21
21
import getChangedFilesPromise from '../getChangedFilesPromise' ;
22
22
import getConfigsOfProjectsToRun from '../getConfigsOfProjectsToRun' ;
Original file line number Diff line number Diff line change 7
7
8
8
export { default as SearchSource } from './SearchSource' ;
9
9
export { createTestScheduler } from './TestScheduler' ;
10
- export { default as TestWatcher } from './TestWatcher' ;
11
10
export { runCLI } from './cli' ;
12
11
export { default as getVersion } from './version' ;
Original file line number Diff line number Diff line change @@ -24,10 +24,10 @@ import Resolver from 'jest-resolve';
24
24
import type { Context } from 'jest-runtime' ;
25
25
import { requireOrImportModule , tryRealpath } from 'jest-util' ;
26
26
import { JestHook , JestHookEmitter } from 'jest-watcher' ;
27
+ import type { TestWatcher } from 'jest-watcher' ;
27
28
import type FailedTestsCache from './FailedTestsCache' ;
28
29
import SearchSource from './SearchSource' ;
29
30
import { TestSchedulerContext , createTestScheduler } from './TestScheduler' ;
30
- import type TestWatcher from './TestWatcher' ;
31
31
import collectNodeHandles , { HandleCollectionResult } from './collectHandles' ;
32
32
import getNoTestsFoundMessage from './getNoTestsFoundMessage' ;
33
33
import runGlobalHook from './runGlobalHook' ;
Original file line number Diff line number Diff line change @@ -28,12 +28,12 @@ import {
28
28
AllowedConfigOptions ,
29
29
JestHook ,
30
30
KEYS ,
31
+ TestWatcher ,
31
32
WatchPlugin ,
32
33
WatchPluginClass ,
33
34
} from 'jest-watcher' ;
34
35
import FailedTestsCache from './FailedTestsCache' ;
35
36
import SearchSource from './SearchSource' ;
36
- import TestWatcher from './TestWatcher' ;
37
37
import getChangedFilesPromise from './getChangedFilesPromise' ;
38
38
import activeFilters from './lib/activeFiltersMessage' ;
39
39
import createContext from './lib/createContext' ;
Original file line number Diff line number Diff line change @@ -15,9 +15,9 @@ import type {
15
15
OnTestSuccess ,
16
16
TestRunnerContext ,
17
17
TestRunnerOptions ,
18
- TestWatcher ,
19
18
UnsubscribeFn ,
20
19
} from 'jest-runner' ;
20
+ import type { TestWatcher } from 'jest-watcher' ;
21
21
22
22
const globalConfig = { } as Config . GlobalConfig ;
23
23
const runnerContext = { } as TestRunnerContext ;
Original file line number Diff line number Diff line change 34
34
"jest-resolve" : " ^28.0.0-alpha.8" ,
35
35
"jest-runtime" : " ^28.0.0-alpha.8" ,
36
36
"jest-util" : " ^28.0.0-alpha.8" ,
37
+ "jest-watcher" : " ^28.0.0-alpha.8" ,
37
38
"jest-worker" : " ^28.0.0-alpha.8" ,
38
39
"source-map-support" : " ^0.5.6" ,
39
40
"throat" : " ^6.0.1"
Original file line number Diff line number Diff line change 6
6
*
7
7
*/
8
8
9
- import { TestWatcher } from '@jest/core' ;
10
9
import type { TestContext } from '@jest/test-result' ;
11
10
import { makeGlobalConfig , makeProjectConfig } from '@jest/test-utils' ;
11
+ import { TestWatcher } from 'jest-watcher' ;
12
12
import TestRunner from '../index' ;
13
13
14
14
let mockWorkerFarm ;
Original file line number Diff line number Diff line change @@ -15,15 +15,11 @@ import type {
15
15
TestResult ,
16
16
} from '@jest/test-result' ;
17
17
import { deepCyclicCopy } from 'jest-util' ;
18
+ import type { TestWatcher } from 'jest-watcher' ;
18
19
import { PromiseWithCustomMessage , Worker } from 'jest-worker' ;
19
20
import runTest from './runTest' ;
20
21
import type { SerializableResolver , worker } from './testWorker' ;
21
- import {
22
- EmittingTestRunner ,
23
- TestRunnerOptions ,
24
- TestWatcher ,
25
- UnsubscribeFn ,
26
- } from './types' ;
22
+ import { EmittingTestRunner , TestRunnerOptions , UnsubscribeFn } from './types' ;
27
23
28
24
const TEST_WORKER_PATH = require . resolve ( './testWorker' ) ;
29
25
@@ -36,7 +32,6 @@ export type {
36
32
OnTestFailure ,
37
33
OnTestStart ,
38
34
OnTestSuccess ,
39
- TestWatcher ,
40
35
TestRunnerContext ,
41
36
TestRunnerOptions ,
42
37
JestTestRunner ,
Original file line number Diff line number Diff line change 5
5
* LICENSE file in the root directory of this source tree.
6
6
*/
7
7
8
- import type Emittery = require( 'emittery' ) ;
9
8
import type { JestEnvironment } from '@jest/environment' ;
10
9
import type {
11
10
SerializableError ,
@@ -16,6 +15,7 @@ import type {
16
15
} from '@jest/test-result' ;
17
16
import type { Config } from '@jest/types' ;
18
17
import type RuntimeType from 'jest-runtime' ;
18
+ import type { TestWatcher } from 'jest-watcher' ;
19
19
20
20
export type ErrorWithCode = Error & { code ?: string } ;
21
21
@@ -96,12 +96,3 @@ export abstract class EmittingTestRunner extends BaseTestRunner {
96
96
}
97
97
98
98
export type JestTestRunner = CallbackTestRunner | EmittingTestRunner ;
99
-
100
- // TODO: Should live in `@jest/core` or `jest-watcher`
101
- type WatcherState = { interrupted : boolean } ;
102
- export interface TestWatcher extends Emittery < { change : WatcherState } > {
103
- state : WatcherState ;
104
- setState ( state : WatcherState ) : void ;
105
- isInterrupted ( ) : boolean ;
106
- isWatchMode ( ) : boolean ;
107
- }
Original file line number Diff line number Diff line change 20
20
{"path" : " ../jest-transform" },
21
21
{"path" : " ../jest-types" },
22
22
{"path" : " ../jest-util" },
23
+ {"path" : " ../jest-watcher" },
23
24
{"path" : " ../jest-worker" }
24
25
]
25
26
}
Original file line number Diff line number Diff line change 17
17
"@types/node" : " *" ,
18
18
"ansi-escapes" : " ^4.2.1" ,
19
19
"chalk" : " ^4.0.0" ,
20
+ "emittery" : " ^0.10.2" ,
20
21
"jest-util" : " ^28.0.0-alpha.8" ,
21
22
"string-length" : " ^4.0.1"
22
23
},
File renamed without changes.
Original file line number Diff line number Diff line change 8
8
export { default as BaseWatchPlugin } from './BaseWatchPlugin' ;
9
9
export { default as JestHook } from './JestHooks' ;
10
10
export { default as PatternPrompt } from './PatternPrompt' ;
11
+ export { default as TestWatcher } from './TestWatcher' ;
11
12
export * from './constants' ;
12
13
export type {
13
14
AllowedConfigOptions ,
Original file line number Diff line number Diff line change 7
7
8
8
export {
9
9
SearchSource ,
10
- TestWatcher ,
11
10
createTestScheduler ,
12
11
getVersion ,
13
12
runCLI ,
Original file line number Diff line number Diff line change @@ -2557,7 +2557,6 @@ __metadata:
2557
2557
"@types/rimraf": ^3.0.0
2558
2558
ansi-escapes: ^4.2.1
2559
2559
chalk: ^4.0.0
2560
- emittery: ^0.10.2
2561
2560
exit: ^0.1.2
2562
2561
graceful-fs: ^4.2.9
2563
2562
jest-changed-files: ^28.0.0-alpha.3
@@ -13514,6 +13513,7 @@ __metadata:
13514
13513
jest-resolve: ^28.0.0-alpha.8
13515
13514
jest-runtime: ^28.0.0-alpha.8
13516
13515
jest-util: ^28.0.0-alpha.8
13516
+ jest-watcher: ^28.0.0-alpha.8
13517
13517
jest-worker: ^28.0.0-alpha.8
13518
13518
source-map-support: ^0.5.6
13519
13519
throat: ^6.0.1
@@ -13721,6 +13721,7 @@ __metadata:
13721
13721
"@types/node": "*"
13722
13722
ansi-escapes: ^4.2.1
13723
13723
chalk: ^4.0.0
13724
+ emittery: ^0.10.2
13724
13725
jest-util: ^28.0.0-alpha.8
13725
13726
string-length: ^4.0.1
13726
13727
languageName: unknown
You can’t perform that action at this time.
0 commit comments