Skip to content

Commit

Permalink
Standardize filenames: jest-runtime pkg (#7502)
Browse files Browse the repository at this point in the history
* renamed 'run_test.js' to 'runTest.js' and updated imports

* renamed 'test_worker.js' to 'testWorker.js' and updated imports

* added PR to CHANGELOG

* renamed test_runner.test.js to testRunner.test.js

* Consolidated this PR to generic point with other file renames

* Changed filenames for ScriptTransformer.js, shouldInstrument.js and refs
  • Loading branch information
betalantz authored and thymikee committed Jan 8, 2019
1 parent 938f146 commit 8de90fb
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import HasteMap from 'jest-haste-map';
import stableStringify from 'fast-json-stable-stringify';
import slash from 'slash';
import {version as VERSION} from '../package.json';
import shouldInstrument from './should_instrument';
import shouldInstrument from './shouldInstrument';
import writeFileAtomic from 'write-file-atomic';
import {sync as realpath} from 'realpath-native';
import {enhanceUnexpectedTokenMessage} from './helpers';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import vm from 'vm';
import path from 'path';
import os from 'os';
import ScriptTransformer from '../script_transformer';
import ScriptTransformer from '../ScriptTransformer';

jest.mock('vm');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ describe('ScriptTransformer', () => {
transformIgnorePatterns: ['/node_modules/'],
};

ScriptTransformer = require('../script_transformer').default;
ScriptTransformer = require('../ScriptTransformer').default;
};

beforeEach(reset);
afterEach(() => jest.unmock('../should_instrument'));
afterEach(() => jest.unmock('../shouldInstrument'));

it('transforms a file properly', () => {
const scriptTransformer = new ScriptTransformer(config);
Expand Down Expand Up @@ -241,9 +241,9 @@ describe('ScriptTransformer', () => {
});

it('does not transform Node core modules', () => {
jest.mock('../should_instrument');
jest.mock('../shouldInstrument');

const shouldInstrument = require('../should_instrument').default;
const shouldInstrument = require('../shouldInstrument').default;
const scriptTransformer = new ScriptTransformer(config);
const fsSourceCode = process.binding('natives').fs;

Expand Down
4 changes: 2 additions & 2 deletions packages/jest-runtime/src/__tests__/should_instrument.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
*
*/

import shouldInstrument from '../should_instrument';
import shouldInstrument from '../shouldInstrument';

describe('should_instrument', () => {
describe('shouldInstrument', () => {
const defaultFilename = 'source_file.test.js';
const defaultOptions = {
collectCoverage: true,
Expand Down
4 changes: 2 additions & 2 deletions packages/jest-runtime/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ import {escapePathForRegex} from 'jest-regex-util';
import {EXTENSION as SNAPSHOT_EXTENSION} from 'jest-snapshot';
import fs from 'graceful-fs';
import stripBOM from 'strip-bom';
import ScriptTransformer from './script_transformer';
import shouldInstrument from './should_instrument';
import ScriptTransformer from './ScriptTransformer';
import shouldInstrument from './shouldInstrument';
import {run as cliRun} from './cli';
import {options as cliOptions} from './cli/args';
import {findSiblingsWithFileExtension} from './helpers';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import type {Path, ProjectConfig} from 'types/Config';
import type {Options} from './script_transformer';
import type {Options} from './ScriptTransformer';

import path from 'path';
import {escapePathForRegex} from 'jest-regex-util';
Expand Down

0 comments on commit 8de90fb

Please sign in to comment.