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: fix TestUtils.ts to match the types #10034

Merged
merged 1 commit into from
May 14, 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
30 changes: 15 additions & 15 deletions TestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,38 @@ const DEFAULT_GLOBAL_CONFIG: Config.GlobalConfig = {
changedSince: '',
collectCoverage: false,
collectCoverageFrom: [],
collectCoverageOnlyFrom: null,
collectCoverageOnlyFrom: undefined,
coverageDirectory: 'coverage',
coverageProvider: 'babel',
coverageReporters: [],
coverageThreshold: {global: {}},
detectLeaks: false,
detectOpenHandles: false,
enabledTestsMap: null,
enabledTestsMap: undefined,
errorOnDeprecated: false,
expand: false,
filter: null,
filter: undefined,
findRelatedTests: false,
forceExit: false,
globalSetup: null,
globalTeardown: null,
globalSetup: undefined,
globalTeardown: undefined,
json: false,
lastCommit: false,
listTests: false,
logHeapUsage: false,
maxConcurrency: 5,
maxWorkers: 2,
noSCM: null,
noSCM: undefined,
noStackTrace: false,
nonFlagArgs: [],
notify: false,
notifyMode: 'failure-change',
onlyChanged: false,
onlyFailures: false,
outputFile: null,
outputFile: undefined,
passWithNoTests: false,
projects: [],
replname: null,
replname: undefined,
reporters: [],
rootDir: '/test_root_dir/',
runTestsByPath: false,
Expand All @@ -53,7 +53,7 @@ const DEFAULT_GLOBAL_CONFIG: Config.GlobalConfig = {
testFailureExitCode: 1,
testNamePattern: '',
testPathPattern: '',
testResultsProcessor: null,
testResultsProcessor: undefined,
testSequencer: '@jest/test-sequencer',
testTimeout: 5000,
updateSnapshot: 'none',
Expand All @@ -77,10 +77,10 @@ const DEFAULT_PROJECT_CONFIG: Config.ProjectConfig = {
displayName: undefined,
errorOnDeprecated: false,
extraGlobals: [],
filter: null,
filter: undefined,
forceCoverageMatch: [],
globalSetup: null,
globalTeardown: null,
globalSetup: undefined,
globalTeardown: undefined,
globals: {},
haste: {},
moduleDirectories: [],
Expand All @@ -93,7 +93,7 @@ const DEFAULT_PROJECT_CONFIG: Config.ProjectConfig = {
prettierPath: 'prettier',
resetMocks: false,
resetModules: false,
resolver: null,
resolver: undefined,
restoreMocks: false,
rootDir: '/test_root_dir/',
roots: [],
Expand All @@ -102,7 +102,7 @@ const DEFAULT_PROJECT_CONFIG: Config.ProjectConfig = {
setupFilesAfterEnv: [],
skipFilter: false,
skipNodeResolution: false,
snapshotResolver: null,
snapshotResolver: undefined,
snapshotSerializers: [],
testEnvironment: 'node',
testEnvironmentOptions: {},
Expand All @@ -115,7 +115,7 @@ const DEFAULT_PROJECT_CONFIG: Config.ProjectConfig = {
timers: 'real',
transform: [],
transformIgnorePatterns: [],
unmockedModulePathPatterns: null,
unmockedModulePathPatterns: undefined,
watchPathIgnorePatterns: [],
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ exports[`prints the config object 1`] = `
"detectOpenHandles": false,
"errorOnDeprecated": false,
"extraGlobals": [],
"filter": null,
"forceCoverageMatch": [],
"globalSetup": null,
"globalTeardown": null,
"globals": {},
"haste": {},
"moduleDirectories": [],
Expand All @@ -31,7 +28,6 @@ exports[`prints the config object 1`] = `
"prettierPath": "prettier",
"resetMocks": false,
"resetModules": false,
"resolver": null,
"restoreMocks": false,
"rootDir": "/path/to/dir",
"roots": [
Expand All @@ -42,7 +38,6 @@ exports[`prints the config object 1`] = `
"setupFilesAfterEnv": [],
"skipFilter": false,
"skipNodeResolution": false,
"snapshotResolver": null,
"snapshotSerializers": [],
"testEnvironment": "node",
"testEnvironmentOptions": {},
Expand All @@ -57,7 +52,6 @@ exports[`prints the config object 1`] = `
"timers": "real",
"transform": [],
"transformIgnorePatterns": [],
"unmockedModulePathPatterns": null,
"watchPathIgnorePatterns": []
},
"globalConfig": {
Expand All @@ -66,7 +60,6 @@ exports[`prints the config object 1`] = `
"changedSince": "",
"collectCoverage": false,
"collectCoverageFrom": [],
"collectCoverageOnlyFrom": null,
"coverageDirectory": "coverage",
"coverageProvider": "babel",
"coverageReporters": [],
Expand All @@ -75,31 +68,24 @@ exports[`prints the config object 1`] = `
},
"detectLeaks": false,
"detectOpenHandles": false,
"enabledTestsMap": null,
"errorOnDeprecated": false,
"expand": false,
"filter": null,
"findRelatedTests": false,
"forceExit": false,
"globalSetup": null,
"globalTeardown": null,
"json": false,
"lastCommit": false,
"listTests": false,
"logHeapUsage": false,
"maxConcurrency": 5,
"maxWorkers": 2,
"noSCM": null,
"noStackTrace": false,
"nonFlagArgs": [],
"notify": false,
"notifyMode": "failure-change",
"onlyChanged": false,
"onlyFailures": false,
"outputFile": null,
"passWithNoTests": false,
"projects": [],
"replname": null,
"reporters": [],
"rootDir": "/test_root_dir/",
"runTestsByPath": false,
Expand All @@ -108,7 +94,6 @@ exports[`prints the config object 1`] = `
"testFailureExitCode": 1,
"testNamePattern": "",
"testPathPattern": "",
"testResultsProcessor": null,
"testSequencer": "@jest/test-sequencer",
"testTimeout": 5000,
"updateSnapshot": "none",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Object {
"displayName": undefined,
"errorOnDeprecated": false,
"extraGlobals": Array [],
"filter": null,
"filter": undefined,
"forceCoverageMatch": Array [],
"globalSetup": null,
"globalTeardown": null,
"globalSetup": undefined,
"globalTeardown": undefined,
"globals": Object {},
"haste": Object {},
"moduleDirectories": Array [],
Expand All @@ -32,7 +32,7 @@ Object {
"prettierPath": "prettier",
"resetMocks": false,
"resetModules": false,
"resolver": null,
"resolver": undefined,
"restoreMocks": false,
"rootDir": "/",
"roots": Array [],
Expand All @@ -41,7 +41,7 @@ Object {
"setupFilesAfterEnv": Array [],
"skipFilter": false,
"skipNodeResolution": false,
"snapshotResolver": null,
"snapshotResolver": undefined,
"snapshotSerializers": Array [],
"testEnvironment": "node",
"testEnvironmentOptions": Object {},
Expand All @@ -63,7 +63,7 @@ Object {
"transformIgnorePatterns": Array [
"/node_modules/",
],
"unmockedModulePathPatterns": null,
"unmockedModulePathPatterns": undefined,
"watchPathIgnorePatterns": Array [],
},
"instrument": true,
Expand Down Expand Up @@ -229,7 +229,7 @@ exports[`ScriptTransformer uses multiple preprocessors 1`] = `
const TRANSFORMED = {
filename: '/fruits/banana.js',
script: 'module.exports = "banana";',
config: '{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extraGlobals":[],"filter":null,"forceCoverageMatch":[],"globalSetup":null,"globalTeardown":null,"globals":{},"haste":{},"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"resolver":null,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"snapshotResolver":null,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-jasmine2","testURL":"http://localhost","timers":"real","transform":[["^.+\\\\.js$","test_preprocessor"],["^.+\\\\.css$","css-preprocessor"]],"transformIgnorePatterns":["/node_modules/"],"unmockedModulePathPatterns":null,"watchPathIgnorePatterns":[]}',
config: '{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extraGlobals":[],"forceCoverageMatch":[],"globals":{},"haste":{},"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-jasmine2","testURL":"http://localhost","timers":"real","transform":[["^.+\\\\.js$","test_preprocessor"],["^.+\\\\.css$","css-preprocessor"]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]}',
};
`;

Expand All @@ -246,7 +246,7 @@ exports[`ScriptTransformer uses the supplied preprocessor 1`] = `
const TRANSFORMED = {
filename: '/fruits/banana.js',
script: 'module.exports = "banana";',
config: '{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extraGlobals":[],"filter":null,"forceCoverageMatch":[],"globalSetup":null,"globalTeardown":null,"globals":{},"haste":{},"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"resolver":null,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"snapshotResolver":null,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-jasmine2","testURL":"http://localhost","timers":"real","transform":[["^.+\\\\.js$","test_preprocessor"]],"transformIgnorePatterns":["/node_modules/"],"unmockedModulePathPatterns":null,"watchPathIgnorePatterns":[]}',
config: '{"automock":false,"cache":true,"cacheDirectory":"/cache/","clearMocks":false,"coveragePathIgnorePatterns":[],"cwd":"/test_root_dir/","detectLeaks":false,"detectOpenHandles":false,"errorOnDeprecated":false,"extraGlobals":[],"forceCoverageMatch":[],"globals":{},"haste":{},"moduleDirectories":[],"moduleFileExtensions":["js"],"moduleLoader":"/test_module_loader_path","moduleNameMapper":[],"modulePathIgnorePatterns":[],"modulePaths":[],"name":"test","prettierPath":"prettier","resetMocks":false,"resetModules":false,"restoreMocks":false,"rootDir":"/","roots":[],"runner":"jest-runner","setupFiles":[],"setupFilesAfterEnv":[],"skipFilter":false,"skipNodeResolution":false,"snapshotSerializers":[],"testEnvironment":"node","testEnvironmentOptions":{},"testLocationInResults":false,"testMatch":[],"testPathIgnorePatterns":[],"testRegex":["\\\\.test\\\\.js$"],"testRunner":"jest-jasmine2","testURL":"http://localhost","timers":"real","transform":[["^.+\\\\.js$","test_preprocessor"]],"transformIgnorePatterns":["/node_modules/"],"watchPathIgnorePatterns":[]}',
};
`;

Expand Down