Skip to content

Commit f200a1f

Browse files
authored
Remove Config type. (jestjs#3366)
1 parent f960634 commit f200a1f

File tree

16 files changed

+103
-265
lines changed

16 files changed

+103
-265
lines changed

packages/babel-jest/src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
'use strict';
1212

13-
import type {Config, Path} from 'types/Config';
13+
import type {Path, ProjectConfig} from 'types/Config';
1414
import type {TransformOptions} from 'types/Transform';
1515

1616
const crypto = require('crypto');
@@ -104,7 +104,7 @@ const createTransformer = (options: any) => {
104104
process(
105105
src: string,
106106
filename: Path,
107-
config: Config,
107+
config: ProjectConfig,
108108
transformOptions: TransformOptions,
109109
): string {
110110
if (!babel) {

packages/jest-cli/src/__tests__/SearchSource-test.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ describe('SearchSource', () => {
4646
name,
4747
rootDir: '.',
4848
roots: [],
49-
}).config;
49+
}).options;
5050
return Runtime.createContext(config, {maxWorkers}).then(context => {
5151
searchSource = new SearchSource(context);
5252
});
@@ -62,7 +62,7 @@ describe('SearchSource', () => {
6262
roots: [],
6363
testMatch: null,
6464
testRegex: '(/__tests__/.*|(\\.|/)(test|spec))\\.jsx?$',
65-
}).config;
65+
}).options;
6666
return Runtime.createContext(config, {
6767
maxWorkers,
6868
}).then(context => {
@@ -100,7 +100,7 @@ describe('SearchSource', () => {
100100
});
101101

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

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

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

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

182182
it('finds tests with default file extensions using testRegex', () => {
183-
const {config} = normalizeConfig({
183+
const {options: config} = normalizeConfig({
184184
name,
185185
rootDir,
186186
testMatch: null,
@@ -198,7 +198,7 @@ describe('SearchSource', () => {
198198
});
199199

200200
it('finds tests with default file extensions using testMatch', () => {
201-
const {config} = normalizeConfig({
201+
const {options: config} = normalizeConfig({
202202
name,
203203
rootDir,
204204
testMatch,
@@ -216,7 +216,7 @@ describe('SearchSource', () => {
216216
});
217217

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

233233
it('finds tests with totally custom foobar file extensions', () => {
234-
const {config} = normalizeConfig({
234+
const {options: config} = normalizeConfig({
235235
moduleFileExtensions: ['foobar'],
236236
name,
237237
rootDir,
@@ -246,7 +246,7 @@ describe('SearchSource', () => {
246246
});
247247

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

266266
it('finds tests using a regex only', () => {
267-
const {config} = normalizeConfig({
267+
const {options: config} = normalizeConfig({
268268
name,
269269
rootDir,
270270
testMatch: null,
@@ -282,7 +282,7 @@ describe('SearchSource', () => {
282282
});
283283

284284
it('finds tests using a glob only', () => {
285-
const {config} = normalizeConfig({
285+
const {options: config} = normalizeConfig({
286286
name,
287287
rootDir,
288288
testMatch,
@@ -314,7 +314,7 @@ describe('SearchSource', () => {
314314
const rootPath = path.join(rootDir, 'root.js');
315315

316316
beforeEach(done => {
317-
const {config} = normalizeConfig({
317+
const {options: config} = normalizeConfig({
318318
name: 'SearchSource-findRelatedTests-tests',
319319
rootDir,
320320
});
@@ -345,7 +345,7 @@ describe('SearchSource', () => {
345345

346346
describe('findRelatedTestsFromPattern', () => {
347347
beforeEach(done => {
348-
const {config} = normalizeConfig({
348+
const {options: config} = normalizeConfig({
349349
moduleFileExtensions: ['js', 'jsx', 'foobar'],
350350
name,
351351
rootDir,

packages/jest-cli/src/__tests__/runJest-test.js

Lines changed: 0 additions & 104 deletions
This file was deleted.

0 commit comments

Comments
 (0)