Skip to content

Commit

Permalink
fix: break dependency cycle in jest-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed Jan 26, 2019
1 parent f2fb112 commit 74a7719
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

### Fixes

- `[jest-cli]` Break dependency cycle when using Jest programmatically ([#7707](https://github.com/facebook/jest/pull/7707)

### Chore & Maintenance

- `[website]` Fix broken help link on homepage ([#7706](https://github.com/facebook/jest/pull/7706))
Expand Down
3 changes: 1 addition & 2 deletions packages/jest-cli/src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ import rimraf from 'rimraf';
import {sync as realpath} from 'realpath-native';
import init from '../lib/init';
import logDebugMessages from '../lib/log_debug_messages';

const {getVersion} = require('../jest');
import getVersion from '../version';

export async function run(maybeArgv?: Argv, project?: Path) {
try {
Expand Down
5 changes: 2 additions & 3 deletions packages/jest-cli/src/jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,17 @@
* @flow
*/

import {version as VERSION} from '../package.json';

import SearchSource from './SearchSource';
import TestScheduler from './TestScheduler';
import TestWatcher from './TestWatcher';
import {run, runCLI} from './cli';
import getVersion from './version';

module.exports = {
SearchSource,
TestScheduler,
TestWatcher,
getVersion: () => VERSION,
getVersion,
run,
runCLI,
};
14 changes: 14 additions & 0 deletions packages/jest-cli/src/version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow
*/

import {version as VERSION} from '../package.json';

export default function getVersion() {
return VERSION;
}

0 comments on commit 74a7719

Please sign in to comment.