Skip to content

Commit

Permalink
refactor(jest-cli): reduce nesting in the package (#13395)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrazauskas committed Oct 6, 2022
1 parent dfda079 commit 2ecf723
Show file tree
Hide file tree
Showing 24 changed files with 6 additions and 9 deletions.
5 changes: 1 addition & 4 deletions jest.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export default {
testPathIgnorePatterns: [
'/__arbitraries__/',
'/__benchmarks__/',
'/__fixtures__/',
'/__typetests__/',
'/node_modules/',
'/examples/',
Expand All @@ -53,20 +54,16 @@ export default {
'/packages/.*/build',
'/packages/.*/src/__tests__/setPrettyPrint.ts',
'/packages/jest-core/src/__tests__/test_root',
'/packages/jest-core/src/__tests__/__fixtures__/',
'/packages/jest-cli/src/init/__tests__/fixtures/',
'/packages/jest-haste-map/src/__tests__/haste_impl.js',
'/packages/jest-haste-map/src/__tests__/dependencyExtractor.js',
'/packages/jest-haste-map/src/__tests__/test_dotfiles_root/',
'/packages/jest-repl/src/__tests__/test_root',
'/packages/jest-resolve-dependencies/src/__tests__/__fixtures__/',
'/packages/jest-runtime/src/__tests__/defaultResolver.js',
'/packages/jest-runtime/src/__tests__/module_dir/',
'/packages/jest-runtime/src/__tests__/NODE_PATH_dir',
'/packages/jest-snapshot/src/__tests__/plugins',
'/packages/jest-snapshot/src/__tests__/fixtures/',
'/packages/jest-validate/src/__tests__/fixtures/',
'/packages/jest-worker/src/workers/__tests__/__fixtures__/',
'/e2e/__tests__/iterator-to-null-test.ts',
'/e2e/__tests__/tsIntegration.test.ts', // this test needs types to be build, it runs in a separate CI job through `jest.config.ts.mjs`
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

import type {Config} from '@jest/types';
import {constants} from 'jest-config';
import {buildArgv} from '../../cli';
import {check} from '../../cli/args';
import {check} from '../args';
import {buildArgv} from '../run';

const argv = (input: Partial<Config.Argv>): Config.Argv => input as Config.Argv;

Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/jest-cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
* LICENSE file in the root directory of this source tree.
*/

export {run} from './cli';
export {run} from './run';
2 changes: 1 addition & 1 deletion packages/jest-cli/src/init/__tests__/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jest.mock('graceful-fs', () => ({
}));

const resolveFromFixture = (relativePath: string) =>
path.resolve(__dirname, 'fixtures', relativePath);
path.resolve(__dirname, '__fixtures__', relativePath);

const consoleLog = console.log;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import type {Config} from '@jest/types';
import {deprecationEntries} from 'jest-config';
import {clearLine, tryRealpath} from 'jest-util';
import {validateCLIOptions} from 'jest-validate';
import init from '../init';
import * as args from './args';
import init from './init';

export async function run(
maybeArgv?: Array<string>,
Expand Down

0 comments on commit 2ecf723

Please sign in to comment.