Skip to content

Commit

Permalink
chore(jest-core): standardize files name (#10702)
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 authored Oct 25, 2020
1 parent 246b5d3 commit 2e7a87c
Show file tree
Hide file tree
Showing 31 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ module.exports = {
'packages/jest-core/src/ReporterDispatcher.ts',
'packages/jest-core/src/TestScheduler.ts',
'packages/jest-core/src/collectHandles.ts',
'packages/jest-core/src/plugins/update_snapshots_interactive.ts',
'packages/jest-core/src/plugins/UpdateSnapshotsInteractive.ts',
'packages/jest-fake-timers/src/legacyFakeTimers.ts',
'packages/jest-haste-map/src/index.ts',
'packages/jest-haste-map/src/lib/FSEventsWatcher.ts',
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-core/src/__tests__/SearchSource.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ describe('SearchSource', () => {
);
expect(relPaths.sort()).toEqual([
path.normalize('module.jsx'),
path.normalize('no_tests.js'),
path.normalize('noTests.js'),
]);
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ Watch Usage
`;

exports[`Watch mode flows makes watch plugin initialization errors look nice 1`] = `
[Error: Failed to initialize watch plugin "packages/jest-core/src/__tests__/__fixtures__/watch_plugin_throws":
[Error: Failed to initialize watch plugin "packages/jest-core/src/__tests__/__fixtures__/watchPluginThrows":
● Test suite failed to run
initialization error
at Object.<anonymous> (__fixtures__/watch_plugin_throws.js:8:7)
at Object.<anonymous> (__fixtures__/watchPluginThrows.js:8:7)
]
`;
Expand Down
11 changes: 5 additions & 6 deletions packages/jest-core/src/__tests__/watch.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {JestHook, KEYS} from 'jest-watcher';
import TestWatcher from '../TestWatcher';

const runJestMock = jest.fn();
const watchPluginPath = `${__dirname}/__fixtures__/watch_plugin`;
const watchPlugin2Path = `${__dirname}/__fixtures__/watch_plugin2`;
const watchPluginPath = `${__dirname}/__fixtures__/watchPlugin`;
const watchPlugin2Path = `${__dirname}/__fixtures__/watchPlugin2`;
let results;

jest.mock(
Expand Down Expand Up @@ -84,10 +84,9 @@ jest.doMock(
{virtual: true},
);

const regularUpdateGlobalConfig = require('../lib/update_global_config')
.default;
const regularUpdateGlobalConfig = require('../lib/updateGlobalConfig').default;
const updateGlobalConfig = jest.fn(regularUpdateGlobalConfig);
jest.doMock('../lib/update_global_config', () => updateGlobalConfig);
jest.doMock('../lib/updateGlobalConfig', () => updateGlobalConfig);

const nextTick = () => new Promise(res => process.nextTick(res));

Expand Down Expand Up @@ -583,7 +582,7 @@ describe('Watch mode flows', () => {
});

it('makes watch plugin initialization errors look nice', async () => {
const pluginPath = `${__dirname}/__fixtures__/watch_plugin_throws`;
const pluginPath = `${__dirname}/__fixtures__/watchPluginThrows`;

await expect(
watch(
Expand Down
6 changes: 3 additions & 3 deletions packages/jest-core/src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ import chalk = require('chalk');
import rimraf = require('rimraf');
import exit = require('exit');
import type {Filter} from '../types';
import createContext from '../lib/create_context';
import createContext from '../lib/createContext';
import getChangedFilesPromise from '../getChangedFilesPromise';
import {formatHandleErrors} from '../collectHandles';
import handleDeprecationWarnings from '../lib/handle_deprecation_warnings';
import handleDeprecationWarnings from '../lib/handleDeprecationWarnings';
import runJest from '../runJest';
import TestWatcher from '../TestWatcher';
import watch from '../watch';
import pluralize from '../pluralize';
import logDebugMessages from '../lib/log_debug_messages';
import logDebugMessages from '../lib/logDebugMessages';
import getConfigsOfProjectsToRun from '../getConfigsOfProjectsToRun';
import getProjectNamesMissingWarning from '../getProjectNamesMissingWarning';
import getSelectProjectsMessage from '../getSelectProjectsMessage';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import * as path from 'path';
import isValidPath from '../is_valid_path';
import isValidPath from '../isValidPath';
import {makeGlobalConfig} from '../../../../../TestUtils';

const rootDir = path.resolve(path.sep, 'root');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import {wrap} from 'jest-snapshot-serializer-raw';
import logDebugMessages from '../log_debug_messages';
import logDebugMessages from '../logDebugMessages';
import {makeGlobalConfig, makeProjectConfig} from '../../../../../TestUtils';

jest.mock('../../../package.json', () => ({version: 123}));
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
UsageData,
} from 'jest-watcher';
import TestNamePatternPrompt from '../TestNamePatternPrompt';
import activeFilters from '../lib/active_filters_message';
import activeFilters from '../lib/activeFiltersMessage';

class TestNamePatternPlugin extends BaseWatchPlugin {
_prompt: Prompt;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
UsageData,
} from 'jest-watcher';
import TestPathPatternPrompt from '../TestPathPatternPrompt';
import activeFilters from '../lib/active_filters_message';
import activeFilters from '../lib/activeFiltersMessage';

class TestPathPatternPlugin extends BaseWatchPlugin {
private _prompt: Prompt;
Expand Down
20 changes: 10 additions & 10 deletions packages/jest-core/src/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ import {
WatchPluginClass,
} from 'jest-watcher';
import getChangedFilesPromise from './getChangedFilesPromise';
import isValidPath from './lib/is_valid_path';
import createContext from './lib/create_context';
import isValidPath from './lib/isValidPath';
import createContext from './lib/createContext';
import runJest from './runJest';
import updateGlobalConfig from './lib/update_global_config';
import updateGlobalConfig from './lib/updateGlobalConfig';
import SearchSource from './SearchSource';
import TestWatcher from './TestWatcher';
import FailedTestsCache from './FailedTestsCache';
import TestPathPatternPlugin from './plugins/test_path_pattern';
import TestNamePatternPlugin from './plugins/test_name_pattern';
import UpdateSnapshotsPlugin from './plugins/update_snapshots';
import UpdateSnapshotsInteractivePlugin from './plugins/update_snapshots_interactive';
import QuitPlugin from './plugins/quit';
import TestPathPatternPlugin from './plugins/TestPathPattern';
import TestNamePatternPlugin from './plugins/TestNamePattern';
import UpdateSnapshotsPlugin from './plugins/UpdateSnapshots';
import UpdateSnapshotsInteractivePlugin from './plugins/UpdateSnapshotsInteractive';
import QuitPlugin from './plugins/Quit';
import {
filterInteractivePlugins,
getSortedUsageRows,
} from './lib/watch_plugins_helpers';
import activeFilters from './lib/active_filters_message';
} from './lib/watchPluginsHelpers';
import activeFilters from './lib/activeFiltersMessage';
import type {Filter} from './types';

type ReservedInfo = {
Expand Down

0 comments on commit 2e7a87c

Please sign in to comment.