Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize filenames in packages/jest circus #7301

Merged
merged 15 commits into from
Oct 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@

### Chore & Maintenance

- `[jest-circus]` Standardize file naming in `jest-circus` ([#7301](https://github.com/facebook/jest/pull/7301))
- `[docs]` Add synchronous test.each setup ([#7150](https://github.com/facebook/jest/pull/7150))
- `[docs]` Add `this.extend` to the Custom Matchers API reference ([#7130](https://github.com/facebook/jest/pull/7130))
- `[docs]` Fix default value for `coverageReporters` value in configuration docs ([#7126](https://github.com/facebook/jest/pull/7126))
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-circus/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
*/

// Allow people to use `jest-circus/runner` as a runner.
const runner = require('./build/legacy_code_todo_rewrite/jest_adapter');
const runner = require('./build/legacy-code-todo-rewrite/jestAdapter');
module.exports = runner;
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {skipSuiteOnWindows} from '../../../../scripts/ConditionalTest';
const CIRCUS_PATH = require.resolve('../../build/index');
const CIRCUS_RUN_PATH = require.resolve('../../build/run');
const CIRCUS_STATE_PATH = require.resolve('../../build/state');
const TEST_EVENT_HANDLER_PATH = require.resolve('./test_event_handler');
const TEST_EVENT_HANDLER_PATH = require.resolve('./testEventHandler');
const BABEL_REGISTER_PATH = require.resolve('babel-register');

skipSuiteOnWindows();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

'use strict';

import {runTest} from '../__mocks__/test_utils';
import {runTest} from '../__mocks__/testUtils';

test('tests are not marked done until their parent afterAll runs', () => {
const {stdout} = runTest(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

'use strict';

import {runTest} from '../__mocks__/test_utils';
import {runTest} from '../__mocks__/testUtils';

test('simple test', () => {
const {stdout} = runTest(`
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-circus/src/__tests__/hooks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

'use strict';

import {runTest} from '../__mocks__/test_utils';
import {runTest} from '../__mocks__/testUtils';

test('beforeEach is executed before each test in current/child describe blocks', () => {
const {stdout} = runTest(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ import {
import {
injectGlobalErrorHandlers,
restoreGlobalErrorHandlers,
} from './error_handlers';
} from './globalErrorHandlers';

// To pass this value from Runtime object to state we need to use global[sym]
const TEST_TIMEOUT_SYMBOL = Symbol.for('TEST_TIMEOUT_SYMBOL');

const handler: EventHandler = (event, state): void => {
const eventHandler: EventHandler = (event, state): void => {
switch (event.name) {
case 'include_test_location_in_result': {
state.includeTestLocationInResult = true;
Expand Down Expand Up @@ -183,4 +183,4 @@ const handler: EventHandler = (event, state): void => {
}
};

export default handler;
export default eventHandler;
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const humanReadableOperators = {
strictEqual: 'to strictly be equal',
};

export default (event: Event, state: State) => {
const formatNodeAssertErrors = (event: Event, state: State) => {
switch (event.name) {
case 'test_done': {
event.test.errors = event.test.errors.map(errors => {
Expand Down Expand Up @@ -167,3 +167,5 @@ function assertionErrorMessage(error: AssertionError, options: DiffOptions) {
trimmedStack
);
}

export default formatNodeAssertErrors;
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {GlobalConfig, ProjectConfig} from 'types/Config';
import type {TestResult} from 'types/TestResult';
import type Runtime from 'jest-runtime';

const FRAMEWORK_INITIALIZER = require.resolve('./jest_adapter_init');
const FRAMEWORK_INITIALIZER = require.resolve('./jestAdapterInit');
import path from 'path';

const jestAdapter = async (
Expand All @@ -28,7 +28,7 @@ const jestAdapter = async (
} = runtime.requireInternalModule(FRAMEWORK_INITIALIZER);

runtime
.requireInternalModule(path.resolve(__dirname, './jest_expect.js'))
.requireInternalModule(path.resolve(__dirname, './jestExpect.js'))
.default({
expand: globalConfig.expand,
});
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-circus/src/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
import type {Event, State, EventHandler} from 'types/Circus';

import {makeDescribe} from './utils';
import eventHandler from './event_handler';
import formatNodeAssertErrors from './format_node_assert_errors';
import eventHandler from './eventHandler';
import formatNodeAssertErrors from './formatNodeAssertErrors';

const eventHandlers: Array<EventHandler> = [
eventHandler,
Expand Down