Skip to content

Commit

Permalink
Remove Config type. (jestjs#3366)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpojer authored Apr 27, 2017
1 parent f960634 commit f200a1f
Show file tree
Hide file tree
Showing 16 changed files with 103 additions and 265 deletions.
4 changes: 2 additions & 2 deletions packages/babel-jest/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

'use strict';

import type {Config, Path} from 'types/Config';
import type {Path, ProjectConfig} from 'types/Config';
import type {TransformOptions} from 'types/Transform';

const crypto = require('crypto');
Expand Down Expand Up @@ -104,7 +104,7 @@ const createTransformer = (options: any) => {
process(
src: string,
filename: Path,
config: Config,
config: ProjectConfig,
transformOptions: TransformOptions,
): string {
if (!babel) {
Expand Down
30 changes: 15 additions & 15 deletions packages/jest-cli/src/__tests__/SearchSource-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe('SearchSource', () => {
name,
rootDir: '.',
roots: [],
}).config;
}).options;
return Runtime.createContext(config, {maxWorkers}).then(context => {
searchSource = new SearchSource(context);
});
Expand All @@ -62,7 +62,7 @@ describe('SearchSource', () => {
roots: [],
testMatch: null,
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.jsx?$',
}).config;
}).options;
return Runtime.createContext(config, {
maxWorkers,
}).then(context => {
Expand Down Expand Up @@ -100,7 +100,7 @@ describe('SearchSource', () => {
});

it('finds tests matching a pattern via testRegex', () => {
const {config} = normalizeConfig({
const {options: config} = normalizeConfig({
moduleFileExtensions: ['js', 'jsx', 'txt'],
name,
rootDir,
Expand All @@ -121,7 +121,7 @@ describe('SearchSource', () => {
});

it('finds tests matching a pattern via testMatch', () => {
const {config} = normalizeConfig({
const {options: config} = normalizeConfig({
moduleFileExtensions: ['js', 'jsx', 'txt'],
name,
rootDir,
Expand All @@ -142,7 +142,7 @@ describe('SearchSource', () => {
});

it('finds tests matching a JS regex pattern', () => {
const {config} = normalizeConfig({
const {options: config} = normalizeConfig({
moduleFileExtensions: ['js', 'jsx'],
name,
rootDir,
Expand All @@ -161,7 +161,7 @@ describe('SearchSource', () => {
});

it('finds tests matching a JS glob pattern', () => {
const {config} = normalizeConfig({
const {options: config} = normalizeConfig({
moduleFileExtensions: ['js', 'jsx'],
name,
rootDir,
Expand All @@ -180,7 +180,7 @@ describe('SearchSource', () => {
});

it('finds tests with default file extensions using testRegex', () => {
const {config} = normalizeConfig({
const {options: config} = normalizeConfig({
name,
rootDir,
testMatch: null,
Expand All @@ -198,7 +198,7 @@ describe('SearchSource', () => {
});

it('finds tests with default file extensions using testMatch', () => {
const {config} = normalizeConfig({
const {options: config} = normalizeConfig({
name,
rootDir,
testMatch,
Expand All @@ -216,7 +216,7 @@ describe('SearchSource', () => {
});

it('finds tests with similar but custom file extensions', () => {
const {config} = normalizeConfig({
const {options: config} = normalizeConfig({
moduleFileExtensions: ['jsx'],
name,
rootDir,
Expand All @@ -231,7 +231,7 @@ describe('SearchSource', () => {
});

it('finds tests with totally custom foobar file extensions', () => {
const {config} = normalizeConfig({
const {options: config} = normalizeConfig({
moduleFileExtensions: ['foobar'],
name,
rootDir,
Expand All @@ -246,7 +246,7 @@ describe('SearchSource', () => {
});

it('finds tests with many kinds of file extensions', () => {
const {config} = normalizeConfig({
const {options: config} = normalizeConfig({
moduleFileExtensions: ['js', 'jsx'],
name,
rootDir,
Expand All @@ -264,7 +264,7 @@ describe('SearchSource', () => {
});

it('finds tests using a regex only', () => {
const {config} = normalizeConfig({
const {options: config} = normalizeConfig({
name,
rootDir,
testMatch: null,
Expand All @@ -282,7 +282,7 @@ describe('SearchSource', () => {
});

it('finds tests using a glob only', () => {
const {config} = normalizeConfig({
const {options: config} = normalizeConfig({
name,
rootDir,
testMatch,
Expand Down Expand Up @@ -314,7 +314,7 @@ describe('SearchSource', () => {
const rootPath = path.join(rootDir, 'root.js');

beforeEach(done => {
const {config} = normalizeConfig({
const {options: config} = normalizeConfig({
name: 'SearchSource-findRelatedTests-tests',
rootDir,
});
Expand Down Expand Up @@ -345,7 +345,7 @@ describe('SearchSource', () => {

describe('findRelatedTestsFromPattern', () => {
beforeEach(done => {
const {config} = normalizeConfig({
const {options: config} = normalizeConfig({
moduleFileExtensions: ['js', 'jsx', 'foobar'],
name,
rootDir,
Expand Down
104 changes: 0 additions & 104 deletions packages/jest-cli/src/__tests__/runJest-test.js

This file was deleted.

Loading

0 comments on commit f200a1f

Please sign in to comment.