Skip to content

Conversation

@jeysal
Copy link
Collaborator

@jeysal jeysal commented Feb 17, 2019

Summary

migrate jest-resolve-dependencies to TypeScript

Test plan

@jeysal
Copy link
Collaborator Author

jeysal commented Feb 17, 2019

Built diff:

diff --git a/packages/jest-resolve-dependencies/build/index.js b/packages/jest-resolve-dependencies/build/index.js
index 86a547274..a402abe28 100644
--- a/packages/jest-resolve-dependencies/build/index.js
+++ b/packages/jest-resolve-dependencies/build/index.js
@@ -15,8 +15,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.
- *
- *
  */
 
 /**
@@ -76,7 +74,7 @@ class DependencyResolver {
           moduleMap.reduce((acc, module) => {
             if (
               visitedModules.has(module.file) ||
-              !module.dependencies.some(dep => dep && changed.has(dep))
+              !module.dependencies.some(dep => changed.has(dep))
             ) {
               return acc;
             }
@@ -97,6 +95,7 @@ class DependencyResolver {
 
       return result.concat(
         Array.from(related).map(file => ({
+          dependencies: [],
           file
         }))
       );

@codecov-io
Copy link

codecov-io commented Feb 17, 2019

Codecov Report

Merging #7922 into master will decrease coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7922      +/-   ##
==========================================
- Coverage   65.37%   65.32%   -0.05%     
==========================================
  Files         255      255              
  Lines        9940     9938       -2     
  Branches     1030     1039       +9     
==========================================
- Hits         6498     6492       -6     
- Misses       3194     3195       +1     
- Partials      248      251       +3
Impacted Files Coverage Δ
packages/jest-snapshot/src/index.ts 31.25% <ø> (ø) ⬆️
packages/jest-resolve/src/index.ts 40.62% <ø> (ø) ⬆️
packages/jest-resolve-dependencies/src/index.ts 89.13% <100%> (ø)
packages/jest-snapshot/src/snapshot_resolver.ts 96.55% <100%> (ø) ⬆️

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 2f3d557...95553b0. Read the comment docs.

@jeysal jeysal force-pushed the ts-resolve-dependencies branch from 0c16175 to b60516f Compare February 18, 2019 22:05
Copy link
Member

@SimenB SimenB left a comment

Choose a reason for hiding this comment

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

Thanks! Just a couple of nits and I think this is good to go :)

roots: ['./packages/jest-resolve-dependencies'],
});
return Runtime.createContext(config, {maxWorkers, watchman: false}).then(
(hasteMap: any) => {
Copy link
Member

Choose a reason for hiding this comment

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

Could type as HasteMap, but doesn't matter in a test

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah that's what I meant in #7922 (comment), would prefer to do it in another PR though since I expect it to become rather big

Copy link
Member

Choose a reason for hiding this comment

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

sounds good!

@jeysal jeysal force-pushed the ts-resolve-dependencies branch from 95553b0 to bc96e8b Compare February 19, 2019 18:05
@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 12, 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.

4 participants