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: migrate @jest/core to TypeScript #7998

Merged
merged 30 commits into from Mar 2, 2019
Merged

Conversation

SimenB
Copy link
Member

@SimenB SimenB commented Feb 27, 2019

Summary

This wasn't as bad as I thought it'd be... There's still 34 type errors, but they should be pretty straightforward (I'm sick and it's late, so opening this now). Help very much appreciated!

diff --git c/packages/jest-core/build/FailedTestsCache.js w/packages/jest-core/build/FailedTestsCache.js
index ea8540389..d2677e482 100644
--- c/packages/jest-core/build/FailedTestsCache.js
+++ w/packages/jest-core/build/FailedTestsCache.js
@@ -42,16 +42,16 @@ function _defineProperty(obj, key, value) {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 class FailedTestsCache {
   filterTests(tests) {
-    if (!this._enabledTestsMap) {
+    const enabledTestsMap = this._enabledTestsMap;
+
+    if (!enabledTestsMap) {
       return tests;
-    } // $FlowFixMe
+    }
 
-    return tests.filter(testResult => this._enabledTestsMap[testResult.path]);
+    return tests.filter(testResult => enabledTestsMap[testResult.path]);
   }
 
   setTestResults(testResults) {
diff --git c/packages/jest-core/build/ReporterDispatcher.js w/packages/jest-core/build/ReporterDispatcher.js
index bc740845b..4fc53e82a 100644
--- c/packages/jest-core/build/ReporterDispatcher.js
+++ w/packages/jest-core/build/ReporterDispatcher.js
@@ -42,8 +42,6 @@ function _asyncToGenerator(fn) {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 class ReporterDispatcher {
   constructor() {
diff --git c/packages/jest-core/build/SearchSource.js w/packages/jest-core/build/SearchSource.js
index 482d205de..235be2b00 100644
--- c/packages/jest-core/build/SearchSource.js
+++ w/packages/jest-core/build/SearchSource.js
@@ -199,7 +199,12 @@ class SearchSource {
 
   _filterTestPathsWithStats(allPaths, testPathPattern) {
     const data = {
-      stats: {},
+      stats: {
+        roots: 0,
+        testMatch: 0,
+        testPathIgnorePatterns: 0,
+        testRegex: 0
+      },
       tests: [],
       total: allPaths.length
     };
@@ -215,14 +220,24 @@ class SearchSource {
     data.tests = allPaths.filter(test =>
       testCasesKeys.reduce((flag, key) => {
         if (testCases[key](test.path)) {
-          data.stats[key] = ++data.stats[key] || 1;
+          if (data.stats[key] === undefined) {
+            data.stats[key] = 0;
+          }
+
+          ++data.stats[key];
           return flag && true;
         }
 
         data.stats[key] = data.stats[key] || 0;
         return false;
       }, true)
-    );
+    ); // TODO: Is this necessary? Done to keep the object the same as before the TS migration
+
+    testCasesKeys.forEach(key => {
+      if (data.stats[key] === 0) {
+        delete data.stats[key];
+      }
+    });
     return data;
   }
 
@@ -377,7 +392,7 @@ class SearchSource {
       const filterPath = globalConfig.filter;
 
       if (filterPath && !globalConfig.skipFilter) {
-        const tests = searchResult.tests; // $FlowFixMe: dynamic require.
+        const tests = searchResult.tests;
 
         const filter = require(filterPath);
 
diff --git c/packages/jest-core/build/SnapshotInteractiveMode.js w/packages/jest-core/build/SnapshotInteractiveMode.js
index ac14a6cdc..0d85e0392 100644
--- c/packages/jest-core/build/SnapshotInteractiveMode.js
+++ w/packages/jest-core/build/SnapshotInteractiveMode.js
@@ -55,8 +55,6 @@ function _interopRequireDefault(obj) {
  * This source code is licensed under the BSD-style license found in the
  * LICENSE file in the root directory of this source tree. An additional grant
  * of patent rights can be found in the PATENTS file in the same directory.
- *
- *
  */
 const ARROW = _jestUtil().specialChars.ARROW,
   CLEAR = _jestUtil().specialChars.CLEAR;
@@ -299,7 +297,7 @@ class SnapshotInteractiveMode {
       return;
     }
 
-    this._testAssertions = [].concat(failedSnapshotTestAssertions);
+    this._testAssertions = [...failedSnapshotTestAssertions];
     this._countPaths = this._testAssertions.length;
     this._updateTestRunnerConfig = onConfigChange;
     this._isActive = true;
diff --git c/packages/jest-core/build/TestNamePatternPrompt.js w/packages/jest-core/build/TestNamePatternPrompt.js
index a24a08b2f..e04186392 100644
--- c/packages/jest-core/build/TestNamePatternPrompt.js
+++ w/packages/jest-core/build/TestNamePatternPrompt.js
@@ -20,9 +20,8 @@ function _jestWatcher() {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
+// TODO: Make underscored props `private`
 class TestNamePatternPrompt extends _jestWatcher().PatternPrompt {
   constructor(pipe, prompt) {
     super(pipe, prompt);
@@ -33,10 +32,10 @@ class TestNamePatternPrompt extends _jestWatcher().PatternPrompt {
   _onChange(pattern, options) {
     super._onChange(pattern, options);
 
-    this._printPrompt(pattern, options);
+    this._printPrompt(pattern);
   }
 
-  _printPrompt(pattern, options) {
+  _printPrompt(pattern) {
     const pipe = this._pipe;
     (0, _jestWatcher().printPatternCaret)(pattern, pipe);
     (0, _jestWatcher().printRestoredPatternCaret)(
diff --git c/packages/jest-core/build/TestPathPatternPrompt.js w/packages/jest-core/build/TestPathPatternPrompt.js
index 18caf69e6..727f6a97d 100644
--- c/packages/jest-core/build/TestPathPatternPrompt.js
+++ w/packages/jest-core/build/TestPathPatternPrompt.js
@@ -20,9 +20,8 @@ function _jestWatcher() {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
+// TODO: Make underscored props `private`
 class TestPathPatternPrompt extends _jestWatcher().PatternPrompt {
   constructor(pipe, prompt) {
     super(pipe, prompt);
@@ -32,10 +31,10 @@ class TestPathPatternPrompt extends _jestWatcher().PatternPrompt {
   _onChange(pattern, options) {
     super._onChange(pattern, options);
 
-    this._printPrompt(pattern, options);
+    this._printPrompt(pattern);
   }
 
-  _printPrompt(pattern, options) {
+  _printPrompt(pattern) {
     const pipe = this._pipe;
     (0, _jestWatcher().printPatternCaret)(pattern, pipe);
     (0, _jestWatcher().printRestoredPatternCaret)(
@@ -54,8 +53,8 @@ class TestPathPatternPrompt extends _jestWatcher().PatternPrompt {
 
     let tests = [];
 
-    if (regex) {
-      this._searchSources.forEach(({searchSource, context}) => {
+    if (regex && this._searchSources) {
+      this._searchSources.forEach(({searchSource}) => {
         tests = tests.concat(searchSource.findMatchingTests(pattern).tests);
       });
     }
diff --git c/packages/jest-core/build/TestScheduler.js w/packages/jest-core/build/TestScheduler.js
index 5de2a93c3..de1323b58 100644
--- c/packages/jest-core/build/TestScheduler.js
+++ w/packages/jest-core/build/TestScheduler.js
@@ -25,53 +25,51 @@ function _jestMessageUtil() {
   return data;
 }
 
-var _testResultHelpers = require('./testResultHelpers');
-
-function _reporters() {
-  const data = require('@jest/reporters');
+function _jestSnapshot() {
+  const data = _interopRequireDefault(require('jest-snapshot'));
 
-  _reporters = function _reporters() {
+  _jestSnapshot = function _jestSnapshot() {
     return data;
   };
 
   return data;
 }
 
-function _exit() {
-  const data = _interopRequireDefault(require('exit'));
+function _jestRunner() {
+  const data = _interopRequireDefault(require('jest-runner'));
 
-  _exit = function _exit() {
+  _jestRunner = function _jestRunner() {
     return data;
   };
 
   return data;
 }
 
-var _ReporterDispatcher = _interopRequireDefault(
-  require('./ReporterDispatcher')
-);
-
-function _jestSnapshot() {
-  const data = _interopRequireDefault(require('jest-snapshot'));
+function _reporters() {
+  const data = require('@jest/reporters');
 
-  _jestSnapshot = function _jestSnapshot() {
+  _reporters = function _reporters() {
     return data;
   };
 
   return data;
 }
 
-function _jestRunner() {
-  const data = _interopRequireDefault(require('jest-runner'));
+function _exit() {
+  const data = _interopRequireDefault(require('exit'));
 
-  _jestRunner = function _jestRunner() {
+  _exit = function _exit() {
     return data;
   };
 
   return data;
 }
 
-var _TestWatcher = _interopRequireDefault(require('./TestWatcher'));
+var _testResultHelpers = require('./testResultHelpers');
+
+var _ReporterDispatcher = _interopRequireDefault(
+  require('./ReporterDispatcher')
+);
 
 var _testSchedulerHelper = require('./testSchedulerHelper');
 
@@ -303,13 +301,11 @@ class TestScheduler {
       const testRunners = Object.create(null);
       contexts.forEach(({config}) => {
         if (!testRunners[config.runner]) {
-          // $FlowFixMe
-          testRunners[config.runner] = new (require(config.runner))(
-            _this._globalConfig,
-            {
-              changedFiles: _this._context && _this._context.changedFiles
-            }
-          );
+          const Runner = require(config.runner);
+
+          testRunners[config.runner] = new Runner(_this._globalConfig, {
+            changedFiles: _this._context && _this._context.changedFiles
+          });
         }
       });
 
@@ -443,7 +439,7 @@ class TestScheduler {
   }
 
   _addCustomReporters(reporters) {
-    reporters.forEach((reporter, index) => {
+    reporters.forEach(reporter => {
       const _this$_getReporterPro = this._getReporterProps(reporter),
         options = _this$_getReporterPro.options,
         path = _this$_getReporterPro.path;
@@ -451,7 +447,6 @@ class TestScheduler {
       if (path === 'default') return;
 
       try {
-        // $FlowFixMe
         const Reporter = require(path);
 
         this.addReporter(new Reporter(this._globalConfig, options));
diff --git c/packages/jest-core/build/TestSequencer.js w/packages/jest-core/build/TestSequencer.js
index d21232071..3c89a5b93 100644
--- c/packages/jest-core/build/TestSequencer.js
+++ w/packages/jest-core/build/TestSequencer.js
@@ -34,8 +34,6 @@ function _interopRequireDefault(obj) {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 const FAIL = 0;
 const SUCCESS = 1;
diff --git c/packages/jest-core/build/TestWatcher.js w/packages/jest-core/build/TestWatcher.js
index 25598fc5c..0e7ceffbb 100644
--- c/packages/jest-core/build/TestWatcher.js
+++ w/packages/jest-core/build/TestWatcher.js
@@ -6,7 +6,7 @@ Object.defineProperty(exports, '__esModule', {
 exports.default = void 0;
 
 function _events() {
-  const data = _interopRequireDefault(require('events'));
+  const data = require('events');
 
   _events = function _events() {
     return data;
@@ -15,19 +15,13 @@ function _events() {
   return data;
 }
 
-function _interopRequireDefault(obj) {
-  return obj && obj.__esModule ? obj : {default: obj};
-}
-
 /**
  * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
-class TestWatcher extends _events().default {
+class TestWatcher extends _events().EventEmitter {
   constructor({isWatchMode}) {
     super();
     this.state = {
diff --git c/packages/jest-core/build/cli/index.js w/packages/jest-core/build/cli/index.js
index eab64313f..36a61723e 100644
--- c/packages/jest-core/build/cli/index.js
+++ w/packages/jest-core/build/cli/index.js
@@ -25,6 +25,16 @@ function _jestConfig() {
   return data;
 }
 
+function _jestRuntime() {
+  const data = _interopRequireDefault(require('jest-runtime'));
+
+  _jestRuntime = function _jestRuntime() {
+    return data;
+  };
+
+  return data;
+}
+
 function _chalk() {
   const data = _interopRequireDefault(require('chalk'));
 
@@ -35,7 +45,15 @@ function _chalk() {
   return data;
 }
 
-var _create_context = _interopRequireDefault(require('../lib/create_context'));
+function _rimraf() {
+  const data = _interopRequireDefault(require('rimraf'));
+
+  _rimraf = function _rimraf() {
+    return data;
+  };
+
+  return data;
+}
 
 function _exit() {
   const data = _interopRequireDefault(require('exit'));
@@ -47,6 +65,8 @@ function _exit() {
   return data;
 }
 
+var _create_context = _interopRequireDefault(require('../lib/create_context'));
+
 var _getChangedFilesPromise = _interopRequireDefault(
   require('../getChangedFilesPromise')
 );
@@ -59,32 +79,12 @@ var _handle_deprecation_warnings = _interopRequireDefault(
 
 var _runJest = _interopRequireDefault(require('../runJest'));
 
-function _jestRuntime() {
-  const data = _interopRequireDefault(require('jest-runtime'));
-
-  _jestRuntime = function _jestRuntime() {
-    return data;
-  };
-
-  return data;
-}
-
 var _TestWatcher = _interopRequireDefault(require('../TestWatcher'));
 
 var _watch = _interopRequireDefault(require('../watch'));
 
 var _pluralize = _interopRequireDefault(require('../pluralize'));
 
-function _rimraf() {
-  const data = _interopRequireDefault(require('rimraf'));
-
-  _rimraf = function _rimraf() {
-    return data;
-  };
-
-  return data;
-}
-
 var _log_debug_messages = _interopRequireDefault(
   require('../lib/log_debug_messages')
 );
@@ -324,7 +324,7 @@ const runWatch =
   (function() {
     var _ref6 = _asyncToGenerator(function*(
       contexts,
-      configs,
+      _configs,
       hasDeprecationWarnings,
       globalConfig,
       outputStream,
@@ -381,7 +381,7 @@ const runWithoutWatch =
             return (0, _runJest.default)({
               changedFilesPromise,
               contexts,
-              failedTestsCache: null,
+              failedTestsCache: undefined,
               globalConfig,
               onComplete,
               outputStream,
diff --git c/packages/jest-core/build/collectHandles.js w/packages/jest-core/build/collectHandles.js
index fa039b21f..4dc0d2abd 100644
--- c/packages/jest-core/build/collectHandles.js
+++ w/packages/jest-core/build/collectHandles.js
@@ -45,8 +45,6 @@ function _interopRequireDefault(obj) {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 function stackIsFromUser(stack) {
   // Either the test file, or something required by it
@@ -71,23 +69,9 @@ function stackIsFromUser(stack) {
 
 function collectHandles() {
   const activeHandles = new Map();
-
-  function initHook(asyncId, type) {
-    if (type === 'PROMISE' || type === 'TIMERWRAP') {
-      return;
-    }
-
-    const error = new (_jestUtil()).ErrorWithStack(type, initHook);
-
-    if (stackIsFromUser(error.stack)) {
-      activeHandles.set(asyncId, error);
-    }
-  }
-
   let hook;
 
   try {
-    // $FlowFixMe: Node core module
     const asyncHooks = require('async_hooks');
 
     hook = asyncHooks.createHook({
@@ -95,7 +79,17 @@ function collectHandles() {
         activeHandles.delete(asyncId);
       },
 
-      init: initHook
+      init: function initHook(asyncId, type) {
+        if (type === 'PROMISE' || type === 'TIMERWRAP') {
+          return;
+        }
+
+        const error = new (_jestUtil()).ErrorWithStack(type, initHook);
+
+        if (stackIsFromUser(error.stack || '')) {
+          activeHandles.set(asyncId, error);
+        }
+      }
     });
     hook.enable();
   } catch (e) {
diff --git c/packages/jest-core/build/coverage.template w/packages/jest-core/build/coverage.template
deleted file mode 100644
index e69de29bb..000000000
diff --git c/packages/jest-core/build/getChangedFilesPromise.js w/packages/jest-core/build/getChangedFilesPromise.js
index 8c9af95f3..f960718b0 100644
--- c/packages/jest-core/build/getChangedFilesPromise.js
+++ w/packages/jest-core/build/getChangedFilesPromise.js
@@ -44,13 +44,11 @@ function _interopRequireDefault(obj) {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 var _default = (globalConfig, configs) => {
   if (globalConfig.onlyChanged) {
     const allRootsForAllProjects = configs.reduce(
-      (roots, config) => roots.concat(config.roots || []),
+      (roots, config) => [...roots, ...(config.roots || [])],
       []
     );
     return (0, _jestChangedFiles().getChangedFilesForRoots)(
diff --git c/packages/jest-core/build/getNoTestFound.js w/packages/jest-core/build/getNoTestFound.js
index d69385cf7..78fb4795a 100644
--- c/packages/jest-core/build/getNoTestFound.js
+++ w/packages/jest-core/build/getNoTestFound.js
@@ -26,12 +26,10 @@ function _interopRequireDefault(obj) {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 function getNoTestFound(testRunData, globalConfig) {
   const testFiles = testRunData.reduce(
-    (current, testRun) => current + testRun.matches.total || 0,
+    (current, testRun) => current + (testRun.matches.total || 0) || 0,
     0
   );
   let dataMessage;
diff --git c/packages/jest-core/build/getNoTestFoundVerbose.js w/packages/jest-core/build/getNoTestFoundVerbose.js
index f1c03409b..b3c380d91 100644
--- c/packages/jest-core/build/getNoTestFoundVerbose.js
+++ w/packages/jest-core/build/getNoTestFoundVerbose.js
@@ -35,8 +35,11 @@ function getNoTestFoundVerbose(testRunData, globalConfig) {
         const value = config[key];
 
         if (value) {
+          const valueAsString = Array.isArray(value) ? value.join(', ') : value;
           const matches = (0, _pluralize.default)('match', stats[key], 'es');
-          return `  ${key}: ${_chalk().default.yellow(value)} - ${matches}`;
+          return `  ${key}: ${_chalk().default.yellow(
+            valueAsString
+          )} - ${matches}`;
         }
 
         return null;
diff --git c/packages/jest-core/build/getNoTestsFoundMessage.js w/packages/jest-core/build/getNoTestsFoundMessage.js
index f51e282e8..055fb8495 100644
--- c/packages/jest-core/build/getNoTestsFoundMessage.js
+++ w/packages/jest-core/build/getNoTestsFoundMessage.js
@@ -28,8 +28,6 @@ function _interopRequireDefault(obj) {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 function getNoTestsFoundMessage(testRunData, globalConfig) {
   if (globalConfig.onlyFailures) {
diff --git c/packages/jest-core/build/lib/active_filters_message.js w/packages/jest-core/build/lib/active_filters_message.js
index eea406671..ae3bafa3d 100644
--- c/packages/jest-core/build/lib/active_filters_message.js
+++ w/packages/jest-core/build/lib/active_filters_message.js
@@ -24,8 +24,6 @@ function _interopRequireDefault(obj) {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 const activeFilters = (globalConfig, delimiter = '\n') => {
   const testNamePattern = globalConfig.testNamePattern,
diff --git c/packages/jest-core/build/lib/create_context.js w/packages/jest-core/build/lib/create_context.js
index d0f5dfbbe..dd974afaa 100644
--- c/packages/jest-core/build/lib/create_context.js
+++ w/packages/jest-core/build/lib/create_context.js
@@ -24,8 +24,6 @@ function _interopRequireDefault(obj) {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 var _default = (config, {hasteFS, moduleMap}) => ({
   config,
diff --git c/packages/jest-core/build/lib/handle_deprecation_warnings.js w/packages/jest-core/build/lib/handle_deprecation_warnings.js
index 9594ec652..615eeeb98 100644
--- c/packages/jest-core/build/lib/handle_deprecation_warnings.js
+++ w/packages/jest-core/build/lib/handle_deprecation_warnings.js
@@ -34,8 +34,6 @@ function _interopRequireDefault(obj) {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 var _default = (pipe, stdin = process.stdin) =>
   new Promise((resolve, reject) => {
@@ -49,8 +47,7 @@ var _default = (pipe, stdin = process.stdin) =>
           'Esc' +
           _chalk().default.dim(' to exit.')
       ];
-      pipe.write(messages.join('\n')); // $FlowFixMe
-
+      pipe.write(messages.join('\n'));
       stdin.setRawMode(true);
       stdin.resume();
       stdin.setEncoding('utf8');
diff --git c/packages/jest-core/build/lib/is_valid_path.js w/packages/jest-core/build/lib/is_valid_path.js
index 7cd13a2d6..7e7c50d40 100644
--- c/packages/jest-core/build/lib/is_valid_path.js
+++ w/packages/jest-core/build/lib/is_valid_path.js
@@ -20,8 +20,6 @@ function _jestSnapshot() {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 function isValidPath(globalConfig, filePath) {
   return (
diff --git c/packages/jest-core/build/lib/log_debug_messages.js w/packages/jest-core/build/lib/log_debug_messages.js
index 3ca4dcf41..d465e51b3 100644
--- c/packages/jest-core/build/lib/log_debug_messages.js
+++ w/packages/jest-core/build/lib/log_debug_messages.js
@@ -5,21 +5,19 @@ Object.defineProperty(exports, '__esModule', {
 });
 exports.default = logDebugMessages;
 
-var _package = require('../../package.json');
-
 /**
  * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
+const VERSION = require('../../package.json').version;
+
 function logDebugMessages(globalConfig, configs, outputStream) {
   const output = {
     configs,
     globalConfig,
-    version: _package.version
+    version: VERSION
   };
   outputStream.write(JSON.stringify(output, null, '  ') + '\n');
 }
diff --git c/packages/jest-core/build/lib/update_global_config.js w/packages/jest-core/build/lib/update_global_config.js
index c0bbdc7bd..067ae8cf1 100644
--- c/packages/jest-core/build/lib/update_global_config.js
+++ w/packages/jest-core/build/lib/update_global_config.js
@@ -47,13 +47,9 @@ function _defineProperty(obj, key, value) {
   return obj;
 }
 
-var _default = (globalConfig, options) => {
+var _default = (globalConfig, options = {}) => {
   const newConfig = _objectSpread({}, globalConfig);
 
-  if (!options) {
-    options = {};
-  }
-
   if (options.mode === 'watch') {
     newConfig.watch = true;
     newConfig.watchAll = false;
@@ -106,7 +102,7 @@ var _default = (globalConfig, options) => {
 
   if (options.coverageReporters !== undefined) {
     newConfig.coverageReporters = options.coverageReporters;
-  }
+  } // @ts-ignore: does it make sense to be able to set this?
 
   if (options.noSCM) {
     newConfig.noSCM = true;
diff --git c/packages/jest-core/build/lib/watch_plugins_helpers.js w/packages/jest-core/build/lib/watch_plugins_helpers.js
index 168ccd1ec..e1933a1d2 100644
--- c/packages/jest-core/build/lib/watch_plugins_helpers.js
+++ w/packages/jest-core/build/lib/watch_plugins_helpers.js
@@ -10,17 +10,17 @@ exports.getSortedUsageRows = exports.filterInteractivePlugins = void 0;
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 const filterInteractivePlugins = (watchPlugins, globalConfig) => {
   const usageInfos = watchPlugins.map(
     p => p.getUsageInfo && p.getUsageInfo(globalConfig)
   );
-  return watchPlugins.filter((plugin, i, array) => {
-    if (usageInfos[i]) {
-      const key = usageInfos[i].key;
-      return !usageInfos.slice(i + 1).some(u => u && key === u.key);
+  return watchPlugins.filter((_plugin, i) => {
+    const usageInfo = usageInfos[i];
+
+    if (usageInfo) {
+      const key = usageInfo.key;
+      return !usageInfos.slice(i + 1).some(u => !!u && key === u.key);
     }
 
     return false;
@@ -29,6 +29,10 @@ const filterInteractivePlugins = (watchPlugins, globalConfig) => {
 
 exports.filterInteractivePlugins = filterInteractivePlugins;
 
+function notEmpty(value) {
+  return value != null;
+}
+
 const getSortedUsageRows = (watchPlugins, globalConfig) =>
   filterInteractivePlugins(watchPlugins, globalConfig)
     .sort((a, b) => {
@@ -53,6 +57,6 @@ const getSortedUsageRows = (watchPlugins, globalConfig) =>
       return 0;
     })
     .map(p => p.getUsageInfo && p.getUsageInfo(globalConfig))
-    .filter(Boolean);
+    .filter(notEmpty);
 
 exports.getSortedUsageRows = getSortedUsageRows;
diff --git c/packages/jest-core/build/plugins/test_name_pattern.js w/packages/jest-core/build/plugins/test_name_pattern.js
index b3aee7446..94a341a0f 100644
--- c/packages/jest-core/build/plugins/test_name_pattern.js
+++ w/packages/jest-core/build/plugins/test_name_pattern.js
@@ -32,8 +32,6 @@ function _interopRequireDefault(obj) {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 class TestNamePatternPlugin extends _jestWatcher().BaseWatchPlugin {
   constructor(options) {
diff --git c/packages/jest-core/build/plugins/test_path_pattern.js w/packages/jest-core/build/plugins/test_path_pattern.js
index 7f4a25026..309980e00 100644
--- c/packages/jest-core/build/plugins/test_path_pattern.js
+++ w/packages/jest-core/build/plugins/test_path_pattern.js
@@ -32,8 +32,6 @@ function _interopRequireDefault(obj) {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 class TestPathPatternPlugin extends _jestWatcher().BaseWatchPlugin {
   constructor(options) {
diff --git c/packages/jest-core/build/plugins/update_snapshots.js w/packages/jest-core/build/plugins/update_snapshots.js
index 8a815a9b3..b01d4d182 100644
--- c/packages/jest-core/build/plugins/update_snapshots.js
+++ w/packages/jest-core/build/plugins/update_snapshots.js
@@ -20,16 +20,15 @@ function _jestWatcher() {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 class UpdateSnapshotsPlugin extends _jestWatcher().BaseWatchPlugin {
   constructor(options) {
     super(options);
     this.isInternal = true;
+    this._hasSnapshotFailure = false;
   }
 
-  run(globalConfig, updateConfigAndRun) {
+  run(_globalConfig, updateConfigAndRun) {
     updateConfigAndRun({
       updateSnapshot: 'all'
     });
@@ -42,7 +41,7 @@ class UpdateSnapshotsPlugin extends _jestWatcher().BaseWatchPlugin {
     });
   }
 
-  getUsageInfo(globalConfig) {
+  getUsageInfo() {
     if (this._hasSnapshotFailure) {
       return {
         key: 'u',
diff --git c/packages/jest-core/build/plugins/update_snapshots_interactive.js w/packages/jest-core/build/plugins/update_snapshots_interactive.js
index 458098e18..aad2b7c50 100644
--- c/packages/jest-core/build/plugins/update_snapshots_interactive.js
+++ w/packages/jest-core/build/plugins/update_snapshots_interactive.js
@@ -28,8 +28,6 @@ function _interopRequireDefault(obj) {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 class UpdateSnapshotInteractivePlugin extends _jestWatcher().BaseWatchPlugin {
   constructor(options) {
@@ -81,7 +79,7 @@ class UpdateSnapshotInteractivePlugin extends _jestWatcher().BaseWatchPlugin {
     }
   }
 
-  run(globalConfig, updateConfigAndRun) {
+  run(_globalConfig, updateConfigAndRun) {
     if (this._failedSnapshotTestAssertions.length) {
       return new Promise(res => {
         this._snapshotInteractiveMode.run(
@@ -105,7 +103,7 @@ class UpdateSnapshotInteractivePlugin extends _jestWatcher().BaseWatchPlugin {
     }
   }
 
-  getUsageInfo(globalConfig) {
+  getUsageInfo() {
     if (
       this._failedSnapshotTestAssertions &&
       this._failedSnapshotTestAssertions.length > 0
diff --git c/packages/jest-core/build/runGlobalHook.js w/packages/jest-core/build/runGlobalHook.js
index 45026d919..00beee26c 100644
--- c/packages/jest-core/build/runGlobalHook.js
+++ w/packages/jest-core/build/runGlobalHook.js
@@ -90,67 +90,80 @@ function _interopRequireDefault(obj) {
       };
 }
 
-var _default = ({allTests, globalConfig, moduleName}) => {
-  const globalModulePaths = new Set(
-    allTests.map(test => test.context.config[moduleName])
-  );
+var _default =
+  /*#__PURE__*/
+  (function() {
+    var _ref = _asyncToGenerator(function*({
+      allTests,
+      globalConfig,
+      moduleName
+    }) {
+      const globalModulePaths = new Set(
+        allTests.map(test => test.context.config[moduleName])
+      );
+
+      if (globalConfig[moduleName]) {
+        globalModulePaths.add(globalConfig[moduleName]);
+      }
 
-  if (globalConfig[moduleName]) {
-    globalModulePaths.add(globalConfig[moduleName]);
-  }
+      if (globalModulePaths.size > 0) {
+        yield (0, _pEachSeries().default)(
+          Array.from(globalModulePaths),
+          /*#__PURE__*/
+          (function() {
+            var _ref2 = _asyncToGenerator(function*(modulePath) {
+              if (!modulePath) {
+                return;
+              }
+
+              const correctConfig = allTests.find(
+                t => t.context.config[moduleName] === modulePath
+              );
+              const projectConfig = correctConfig
+                ? correctConfig.context.config // Fallback to first config
+                : allTests[0].context.config;
+              const transformer = new (_transform()).ScriptTransformer(
+                projectConfig
+              ); // Load the transformer to avoid a cycle where we need to load a
+              // transformer in order to transform it in the require hooks
+
+              transformer.preloadTransformer(modulePath);
+              const revertHook = (0, _pirates().addHook)(
+                (code, filename) =>
+                  transformer.transformSource(filename, code, false).code ||
+                  code,
+                {
+                  exts: [(0, _path().extname)(modulePath)],
+                  matcher: transformer.shouldTransform.bind(transformer)
+                }
+              );
+
+              const globalModule = _interopRequireDefault(require(modulePath))
+                .default;
+
+              if (typeof globalModule !== 'function') {
+                throw new TypeError(
+                  `${moduleName} file must export a function at ${modulePath}`
+                );
+              }
+
+              yield globalModule(globalConfig);
+              revertHook();
+            });
+
+            return function(_x2) {
+              return _ref2.apply(this, arguments);
+            };
+          })()
+        );
+      }
 
-  if (globalModulePaths.size > 0) {
-    return (0, _pEachSeries().default)(
-      Array.from(globalModulePaths),
-      /*#__PURE__*/
-      (function() {
-        var _ref = _asyncToGenerator(function*(modulePath) {
-          if (!modulePath) {
-            return;
-          }
-
-          const correctConfig = allTests.find(
-            t => t.context.config[moduleName] === modulePath
-          );
-          const projectConfig = correctConfig
-            ? correctConfig.context.config // Fallback to first config
-            : allTests[0].context.config;
-          const transformer = new (_transform()).ScriptTransformer(
-            projectConfig
-          ); // Load the transformer to avoid a cycle where we need to load a
-          // transformer in order to transform it in the require hooks
-
-          transformer.preloadTransformer(modulePath);
-          const revertHook = (0, _pirates().addHook)(
-            (code, filename) =>
-              transformer.transformSource(filename, code, false).code || code,
-            {
-              exts: [(0, _path().extname)(modulePath)],
-              matcher: transformer._shouldTransform.bind(transformer)
-            }
-          ); // $FlowFixMe
-
-          const globalModule = _interopRequireDefault(require(modulePath))
-            .default;
-
-          if (typeof globalModule !== 'function') {
-            throw new TypeError(
-              `${moduleName} file must export a function at ${modulePath}`
-            );
-          }
-
-          yield globalModule(globalConfig);
-          revertHook();
-        });
-
-        return function(_x) {
-          return _ref.apply(this, arguments);
-        };
-      })()
-    );
-  }
+      return Promise.resolve();
+    });
 
-  return Promise.resolve();
-};
+    return function(_x) {
+      return _ref.apply(this, arguments);
+    };
+  })();
 
 exports.default = _default;
diff --git c/packages/jest-core/build/runJest.js w/packages/jest-core/build/runJest.js
index 578ca537b..2c75a9ae7 100644
--- c/packages/jest-core/build/runJest.js
+++ w/packages/jest-core/build/runJest.js
@@ -5,20 +5,20 @@ Object.defineProperty(exports, '__esModule', {
 });
 exports.default = void 0;
 
-function _chalk() {
-  const data = _interopRequireDefault(require('chalk'));
+function _path() {
+  const data = _interopRequireDefault(require('path'));
 
-  _chalk = function _chalk() {
+  _path = function _path() {
     return data;
   };
 
   return data;
 }
 
-function _path() {
-  const data = _interopRequireDefault(require('path'));
+function _chalk() {
+  const data = _interopRequireDefault(require('chalk'));
 
-  _path = function _path() {
+  _chalk = function _chalk() {
     return data;
   };
 
@@ -65,6 +65,16 @@ function _gracefulFs() {
   return data;
 }
 
+function _jestWatcher() {
+  const data = require('jest-watcher');
+
+  _jestWatcher = function _jestWatcher() {
+    return data;
+  };
+
+  return data;
+}
+
 var _getNoTestsFoundMessage = _interopRequireDefault(
   require('./getNoTestsFoundMessage')
 );
@@ -79,18 +89,6 @@ var _TestSequencer = _interopRequireDefault(require('./TestSequencer'));
 
 var _testResultHelpers = require('./testResultHelpers');
 
-var _FailedTestsCache = _interopRequireDefault(require('./FailedTestsCache'));
-
-function _jestWatcher() {
-  const data = require('jest-watcher');
-
-  _jestWatcher = function _jestWatcher() {
-    return data;
-  };
-
-  return data;
-}
-
 var _collectHandles = _interopRequireDefault(require('./collectHandles'));
 
 function _interopRequireDefault(obj) {
@@ -193,7 +191,7 @@ const getTestPaths =
           })
         )
       );
-      const filteredTests = data.tests.filter((test, i) => shouldTestArray[i]);
+      const filteredTests = data.tests.filter((_test, i) => shouldTestArray[i]);
       return _objectSpread({}, data, {
         allTests: filteredTests.length,
         tests: filteredTests
@@ -207,7 +205,7 @@ const getTestPaths =
 
 const processResults = (runResults, options) => {
   const outputFile = options.outputFile,
-    isJSON = options.isJSON,
+    isJSON = options.json,
     onComplete = options.onComplete,
     outputStream = options.outputStream,
     testResultsProcessor = options.testResultsProcessor,
@@ -220,7 +218,6 @@ const processResults = (runResults, options) => {
   }
 
   if (testResultsProcessor) {
-    /* $FlowFixMe */
     runResults = require(testResultsProcessor)(runResults);
   }
 
@@ -405,7 +402,7 @@ var _default =
 
       return processResults(results, {
         collectHandles,
-        isJSON: globalConfig.json,
+        json: globalConfig.json,
         onComplete,
         outputFile: globalConfig.outputFile,
         outputStream,
diff --git c/packages/jest-core/build/testResultHelpers.js w/packages/jest-core/build/testResultHelpers.js
index f3f68c0b9..d569bb8d9 100644
--- c/packages/jest-core/build/testResultHelpers.js
+++ w/packages/jest-core/build/testResultHelpers.js
@@ -10,8 +10,6 @@ exports.addResult = exports.buildFailureTestResult = exports.makeEmptyAggregated
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 const makeEmptyAggregatedTestResult = () => ({
   numFailedTestSuites: 0,
diff --git c/packages/jest-core/build/testSchedulerHelper.js w/packages/jest-core/build/testSchedulerHelper.js
index 107869dce..260f57df8 100644
--- c/packages/jest-core/build/testSchedulerHelper.js
+++ w/packages/jest-core/build/testSchedulerHelper.js
@@ -1,17 +1,16 @@
-/**
- * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- *
- *
- */
 'use strict';
 
 Object.defineProperty(exports, '__esModule', {
   value: true
 });
 exports.shouldRunInBand = shouldRunInBand;
+
+/**
+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
+ *
+ * This source code is licensed under the MIT license found in the
+ * LICENSE file in the root directory of this source tree.
+ */
 const SLOW_TEST_TIME = 1000;
 
 function shouldRunInBand(tests, isWatchMode, maxWorkers, timings) {
diff --git c/packages/jest-core/build/watch.js w/packages/jest-core/build/watch.js
index 5da3eda18..dfb9d1241 100644
--- c/packages/jest-core/build/watch.js
+++ w/packages/jest-core/build/watch.js
@@ -25,10 +25,6 @@ function _chalk() {
   return data;
 }
 
-var _getChangedFilesPromise = _interopRequireDefault(
-  require('./getChangedFilesPromise')
-);
-
 function _exit() {
   const data = _interopRequireDefault(require('exit'));
 
@@ -39,38 +35,52 @@ function _exit() {
   return data;
 }
 
-function _jestHasteMap() {
-  const data = _interopRequireDefault(require('jest-haste-map'));
+function _jestMessageUtil() {
+  const data = require('jest-message-util');
 
-  _jestHasteMap = function _jestHasteMap() {
+  _jestMessageUtil = function _jestMessageUtil() {
     return data;
   };
 
   return data;
 }
 
-function _jestMessageUtil() {
-  const data = require('jest-message-util');
+function _jestUtil() {
+  const data = require('jest-util');
 
-  _jestMessageUtil = function _jestMessageUtil() {
+  _jestUtil = function _jestUtil() {
     return data;
   };
 
   return data;
 }
 
-var _is_valid_path = _interopRequireDefault(require('./lib/is_valid_path'));
+function _jestValidate() {
+  const data = require('jest-validate');
 
-function _jestUtil() {
-  const data = require('jest-util');
+  _jestValidate = function _jestValidate() {
+    return data;
+  };
 
-  _jestUtil = function _jestUtil() {
+  return data;
+}
+
+function _jestWatcher() {
+  const data = require('jest-watcher');
+
+  _jestWatcher = function _jestWatcher() {
     return data;
   };
 
   return data;
 }
 
+var _getChangedFilesPromise = _interopRequireDefault(
+  require('./getChangedFilesPromise')
+);
+
+var _is_valid_path = _interopRequireDefault(require('./lib/is_valid_path'));
+
 var _create_context = _interopRequireDefault(require('./lib/create_context'));
 
 var _runJest = _interopRequireDefault(require('./runJest'));
@@ -85,16 +95,6 @@ var _TestWatcher = _interopRequireDefault(require('./TestWatcher'));
 
 var _FailedTestsCache = _interopRequireDefault(require('./FailedTestsCache'));
 
-function _jestWatcher() {
-  const data = require('jest-watcher');
-
-  _jestWatcher = function _jestWatcher() {
-    return data;
-  };
-
-  return data;
-}
-
 var _test_path_pattern = _interopRequireDefault(
   require('./plugins/test_path_pattern')
 );
@@ -115,16 +115,6 @@ var _quit = _interopRequireDefault(require('./plugins/quit'));
 
 var _watch_plugins_helpers = require('./lib/watch_plugins_helpers');
 
-function _jestValidate() {
-  const data = require('jest-validate');
-
-  _jestValidate = function _jestValidate() {
-    return data;
-  };
-
-  return data;
-}
-
 var _active_filters_message = _interopRequireDefault(
   require('./lib/active_filters_message')
 );
@@ -138,8 +128,6 @@ function _interopRequireDefault(obj) {
  *
  * This source code is licensed under the MIT license found in the
  * LICENSE file in the root directory of this source tree.
- *
- *
  */
 const preRunMessagePrint = _jestUtil().preRunMessage.print;
 
@@ -306,7 +294,6 @@ function watch(
       ) {
         const pluginWithConfig = _step2.value;
 
-        // $FlowFixMe dynamic require
         const ThirdPartyPlugin = require(pluginWithConfig.path);
 
         const plugin = new ThirdPartyPlugin({
@@ -392,6 +379,7 @@ function watch(
     hasExitListener = true;
     process.on('exit', () => {
       if (activePlugin) {
+        // @ts-ignore: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/33423
         outputStream.write(_ansiEscapes().default.cursorDown());
         outputStream.write(_ansiEscapes().default.eraseDown);
       }
@@ -400,7 +388,7 @@ function watch(
 
   const startRun = globalConfig => {
     if (isRunning) {
-      return null;
+      return Promise.resolve(null);
     }
 
     testWatcher = new _TestWatcher.default({
@@ -473,7 +461,6 @@ function watch(
       key === _jestWatcher().KEYS.CONTROL_D
     ) {
       if (typeof stdin.setRawMode === 'function') {
-        // $FlowFixMe
         stdin.setRawMode(false);
       }
 
@@ -586,6 +573,7 @@ function watch(
 
       case 'w':
         if (!shouldDisplayWatchUsage && !isWatchUsageDisplayed) {
+          // @ts-ignore: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/33423
           outputStream.write(_ansiEscapes().default.cursorUp());
           outputStream.write(_ansiEscapes().default.eraseDown);
           outputStream.write(usage(globalConfig, watchPlugins));
@@ -605,7 +593,6 @@ function watch(
   };
 
   if (typeof stdin.setRawMode === 'function') {
-    // $FlowFixMe
     stdin.setRawMode(true);
     stdin.resume();
     stdin.setEncoding('utf8');
@@ -663,16 +650,19 @@ const checkForConflicts = (watchPluginKeys, plugin, globalConfig) => {
 
 const getPluginIdentifier = (
   plugin // This breaks as `displayName` is not defined as a static, but since
-) =>
   // WatchPlugin is an interface, and it is my understanding interface
   // static fields are not definable anymore, no idea how to circumvent
   // this :-(
-  // $FlowFixMe: leave `displayName` be.
-  plugin.constructor.displayName || plugin.constructor.name;
+  // @ts-ignore: leave `displayName` be.
+) => plugin.constructor.displayName || plugin.constructor.name;
 
 const getPluginKey = (plugin, globalConfig) => {
   if (typeof plugin.getUsageInfo === 'function') {
-    return (plugin.getUsageInfo(globalConfig) || {}).key;
+    return (
+      plugin.getUsageInfo(globalConfig) || {
+        key: null
+      }
+    ).key;
   }
 
   return null;

Test plan

Green CI (eventually)

@SimenB
Copy link
Member Author

SimenB commented Feb 27, 2019

This is almost ready, I just have some issues with TestNamePatternPrompt and TestPathPatternPrompt. They define a bunch of methods, fields and arguments that they don't use.

Currently TS doesn't really complain - however I want to make the underscored properties private, at which point it complains.

@rogeliog @cpojer is this something you can provide some context on?

image

A quick caveat is that the base class they extend/implement might be wrong, but I don't think so. Removing unused arguments is simple enough, but I just did the necessary syntax and type changes to the files to make them compile to keep the diff down before feedback

EDIT: Well, you worked as a rubberduck - removed 4 of the 8 errors by fixing the base type 😅

image

@SimenB SimenB marked this pull request as ready for review February 27, 2019 12:17
@SimenB SimenB requested a review from rogeliog February 27, 2019 12:17
@@ -51,30 +56,34 @@ const INTERNAL_PLUGINS = [
QuitPlugin,
];

const RESERVED_KEY_PLUGINS = new Map([
// TODO: Is it correct with constructor here?
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tdd 👋 Does this make sense to you? 🙂

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't 😅 Tests fail

image

Any good idea on how to type it properly? I went with Function for now, but it should really be narrower

@SimenB SimenB changed the title [WIP] chore: migrate @jest/core to TypeScript chore: migrate @jest/core to TypeScript Feb 28, 2019
@SimenB
Copy link
Member Author

SimenB commented Feb 28, 2019

CI will pass whenever I get #8011 to work.

@SimenB
Copy link
Member Author

SimenB commented Mar 1, 2019

@thymikee @jeysal would you be able to review this one? I think it's ready now that I was able to land the babel upgrade 🙂

@@ -24,7 +25,7 @@
"jest-watcher": "^24.0.0",
"micromatch": "^3.1.10",
"p-each-series": "^1.0.0",
"pirates": "^4.0.0",
"pirates": "^4.0.1",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4.0.1 has typings

@@ -1,29 +0,0 @@
// Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no idea what this file is 🤷‍♀️

@codecov-io
Copy link

codecov-io commented Mar 2, 2019

Codecov Report

Merging #7998 into master will decrease coverage by 0.83%.
The diff coverage is 57.52%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7998      +/-   ##
==========================================
- Coverage    64.1%   63.26%   -0.84%     
==========================================
  Files         259      259              
  Lines       10165    10225      +60     
  Branches     1818     2082     +264     
==========================================
- Hits         6516     6469      -47     
- Misses       3250     3270      +20     
- Partials      399      486      +87
Impacted Files Coverage Δ
packages/jest-core/src/testSchedulerHelper.ts 100% <ø> (ø)
packages/jest-watcher/src/PatternPrompt.ts 0% <ø> (ø) ⬆️
...ckages/jest-core/src/lib/active_filters_message.ts 100% <ø> (ø)
packages/jest-core/src/plugins/quit.ts 42.85% <ø> (ø)
...ackages/jest-core/src/plugins/test_path_pattern.ts 100% <ø> (ø)
packages/jest-core/src/getNoTestFoundFailed.ts 0% <ø> (ø)
packages/jest-core/src/lib/create_context.ts 0% <ø> (ø)
packages/jest-core/src/getNoTestsFoundMessage.ts 0% <ø> (ø)
packages/jest-core/src/TestWatcher.ts 42.85% <ø> (ø)
packages/jest-core/src/lib/is_valid_path.ts 100% <ø> (ø)
... and 50 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ae8280f...b149594. Read the comment docs.

Copy link
Contributor

@jeysal jeysal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that took some time to look through. Thanks for tackling this monster 😅

docs/WatchPlugins.md Outdated Show resolved Hide resolved
packages/jest-core/src/SearchSource.ts Show resolved Hide resolved
packages/jest-core/src/SearchSource.ts Outdated Show resolved Hide resolved
packages/jest-core/src/SearchSource.ts Outdated Show resolved Hide resolved
packages/jest-core/src/SearchSource.ts Outdated Show resolved Hide resolved
write(message: string) {
expect(wrap(message)).toMatchSnapshot();
},
} as NodeJS.WriteStream);

it('prints the jest version', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what these tests do or what value the huge snapshots now provide

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for the test change

packages/jest-core/src/lib/update_global_config.ts Outdated Show resolved Hide resolved
packages/jest-core/src/runJest.ts Outdated Show resolved Hide resolved
packages/jest-core/src/watch.ts Outdated Show resolved Hide resolved
packages/jest-transform/src/ScriptTransformer.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@jeysal jeysal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, getting closer 🚀

@SimenB
Copy link
Member Author

SimenB commented Mar 2, 2019

@thymikee feel free to leave feedback after the fact - I just wanna get this in since it tweaks a bunch of other types as well 🙂

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants