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

chore(jest-reporters): standardize files name #10727

Merged
merged 1 commit into from
Oct 28, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import Worker from 'jest-worker';
import glob = require('glob');
import v8toIstanbul = require('v8-to-istanbul');
import type {RawSourceMap} from 'source-map';
import BaseReporter from './base_reporter';
import BaseReporter from './BaseReporter';
import type {
Context,
CoverageReporterOptions,
CoverageWorker,
Test,
} from './types';
import getWatermarks from './get_watermarks';
import getWatermarks from './getWatermarks';

// This is fixed in a newer versions of source-map, but our dependencies are still stuck on old versions
interface FixedRawSourceMap extends Omit<RawSourceMap, 'version'> {
Expand Down Expand Up @@ -149,9 +149,9 @@ export default class CoverageReporter extends BaseReporter {
let worker: CoverageWorker | Worker;

if (this._globalConfig.maxWorkers <= 1) {
worker = require('./coverage_worker');
worker = require('./CoverageWorker');
} else {
worker = new Worker(require.resolve('./coverage_worker'), {
worker = new Worker(require.resolve('./CoverageWorker'), {
exposedMethods: ['worker'],
maxRetries: 2,
numWorkers: this._globalConfig.maxWorkers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import {clearLine, isInteractive} from 'jest-util';
import {getConsoleOutput} from '@jest/console';
import chalk = require('chalk');
import type {ReporterOnStartOptions, Test} from './types';
import BaseReporter from './base_reporter';
import BaseReporter from './BaseReporter';
import Status from './Status';
import getResultHeader from './get_result_header';
import getSnapshotStatus from './get_snapshot_status';
import getResultHeader from './getResultHeader';
import getSnapshotStatus from './getSnapshotStatus';

type write = NodeJS.WriteStream['write'];
type FlushBufferedOutput = () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import type {Config} from '@jest/types';
import type {AggregatedResult} from '@jest/test-result';
import {pluralize} from 'jest-util';
import type {Context, TestSchedulerContext} from './types';
import BaseReporter from './base_reporter';
import BaseReporter from './BaseReporter';

const isDarwin = process.platform === 'darwin';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import type {AggregatedResult, SnapshotSummary} from '@jest/test-result';
import chalk = require('chalk');
import {testPathPatternToRegExp} from 'jest-util';
import type {Context, ReporterOnStartOptions} from './types';
import BaseReporter from './base_reporter';
import BaseReporter from './BaseReporter';
import {getSummary} from './utils';
import getResultHeader from './get_result_header';
import getSnapshotSummary from './get_snapshot_summary';
import getResultHeader from './getResultHeader';
import getSnapshotSummary from './getSnapshotSummary';

const TEST_SUMMARY_THRESHOLD = 20;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
import chalk = require('chalk');
import {formatTime, specialChars} from 'jest-util';
import type {Test} from './types';
import DefaultReporter from './default_reporter';
import DefaultReporter from './DefaultReporter';

const {ICONS} = specialChars;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import path from 'path';
import mock from 'mock-fs';

beforeEach(() => {
CoverageReporter = require('../coverage_reporter').default;
CoverageReporter = require('../CoverageReporter').default;
libCoverage = require('istanbul-lib-coverage');
libSourceMaps = require('istanbul-lib-source-maps');
istanbulReports = require('istanbul-reports');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ beforeEach(() => {

fs = require('graceful-fs');
generateEmptyCoverage = require('../generateEmptyCoverage').default;
worker = require('../coverage_worker').worker;
worker = require('../CoverageWorker').worker;
});

test('resolves to the result of generateEmptyCoverage upon success', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import DefaultReporter from '../default_reporter';
import DefaultReporter from '../DefaultReporter';

jest.mock('jest-util', () => ({
...jest.requireActual('jest-util'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
import type {AggregatedResult} from '@jest/test-result';
import type {Config} from '@jest/types';
import Resolver from 'jest-resolve';
import NotifyReporter from '../notify_reporter';
import NotifyReporter from '../NotifyReporter';
import {makeGlobalConfig} from '../../../../TestUtils';

jest.mock('../default_reporter');
jest.mock('../DefaultReporter');
jest.mock('node-notifier', () => ({
notify: jest.fn(),
}));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let results = [];

function requireReporter() {
jest.isolateModules(() => {
SummaryReporter = require('../summary_reporter').default;
SummaryReporter = require('../SummaryReporter').default;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const wrap = obj => ({suites: obj, tests: [], title: ''});
let groupTestsBySuites;

beforeEach(() => {
const VerboseReporter = require('../verbose_reporter').default;
const VerboseReporter = require('../VerboseReporter').default;
groupTestsBySuites = VerboseReporter.groupTestsBySuites;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import {makeGlobalConfig} from '../../../../TestUtils';
import getResultHeader from '../get_result_header';
import getResultHeader from '../getResultHeader';
const terminalLink = require('terminal-link');

jest.mock('terminal-link', () => jest.fn(() => 'wannabehyperlink'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

'use strict';

import getSnapshotStatus from '../get_snapshot_status';
import getSnapshotStatus from '../getSnapshotStatus';

test('Retrieves the snapshot status', () => {
const snapshotResult = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

'use strict';

import getSnapshotSummary from '../get_snapshot_summary';
import getSnapshotSummary from '../getSnapshotSummary';

const UPDATE_COMMAND = 'press --u';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import getWatermarks from '../get_watermarks';
import getWatermarks from '../getWatermarks';
import {makeGlobalConfig} from '../../../../TestUtils';

describe('getWatermarks', () => {
Expand Down
12 changes: 6 additions & 6 deletions packages/jest-reporters/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ export type {
SnapshotSummary,
TestResult,
} from '@jest/test-result';
export {default as BaseReporter} from './base_reporter';
export {default as CoverageReporter} from './coverage_reporter';
export {default as DefaultReporter} from './default_reporter';
export {default as NotifyReporter} from './notify_reporter';
export {default as SummaryReporter} from './summary_reporter';
export {default as VerboseReporter} from './verbose_reporter';
export {default as BaseReporter} from './BaseReporter';
export {default as CoverageReporter} from './CoverageReporter';
export {default as DefaultReporter} from './DefaultReporter';
export {default as NotifyReporter} from './NotifyReporter';
export {default as SummaryReporter} from './SummaryReporter';
export {default as VerboseReporter} from './VerboseReporter';
export type {
Context,
Reporter,
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-reporters/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
} from '@jest/test-result';
import type {FS as HasteFS, ModuleMap} from 'jest-haste-map';
import type {ResolverType} from 'jest-resolve';
import type {worker} from './coverage_worker';
import type {worker} from './CoverageWorker';

export type ReporterOnStartOptions = {
estimatedTime: number;
Expand Down