Skip to content

Commit bd76829

Browse files
authored
chore: move getVersion to jest-core from cli (#8706)
1 parent f4c6e31 commit bd76829

5 files changed

Lines changed: 11 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
- `[docs]` Add information about using `jest.doMock` with ES6 imports ([#8573](https://github.com/facebook/jest/pull/8573))
3636
- `[docs]` Fix variable name in custom-matcher-api code example ([#8582](https://github.com/facebook/jest/pull/8582))
3737
- `[docs]` Fix example used in custom environment docs ([#8617](https://github.com/facebook/jest/pull/8617))
38+
- `[jest-core]` Add `getVersion` (moved from `jest-cli`) ([#8706](https://github.com/facebook/jest/pull/8706))
3839

3940
### Performance
4041

packages/jest-cli/src/cli/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@ import {AggregatedResult} from '@jest/test-result';
1111
import {clearLine} from 'jest-util';
1212
import {validateCLIOptions} from 'jest-validate';
1313
import {deprecationEntries} from 'jest-config';
14-
import {runCLI} from '@jest/core';
14+
import {getVersion, runCLI} from '@jest/core';
1515
import chalk from 'chalk';
1616
import exit from 'exit';
1717
import yargs from 'yargs';
1818
import {sync as realpath} from 'realpath-native';
1919
import init from '../init';
20-
import getVersion from '../version';
2120
import * as args from './args';
2221

2322
export async function run(maybeArgv?: Array<string>, project?: Config.Path) {

packages/jest-cli/src/index.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,14 @@
66
*/
77

88
// TODO: remove @jest/core exports for the next major
9-
import {runCLI, SearchSource, TestScheduler, TestWatcher} from '@jest/core';
9+
import {
10+
getVersion,
11+
runCLI,
12+
SearchSource,
13+
TestScheduler,
14+
TestWatcher,
15+
} from '@jest/core';
1016
import {run} from './cli';
11-
import {default as getVersion} from './version';
1217

1318
export = {
1419
SearchSource,

packages/jest-core/src/jest.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ export {default as SearchSource} from './SearchSource';
99
export {default as TestScheduler} from './TestScheduler';
1010
export {default as TestWatcher} from './TestWatcher';
1111
export {runCLI} from './cli';
12+
export {default as getVersion} from './version';
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8+
// Cannot be `import` as it's not under TS root dir
89
const {version: VERSION} = require('../package.json');
910

1011
export default function getVersion(): string {

0 commit comments

Comments
 (0)