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-resolve-dependencies to TypeScript #7922

Merged
merged 7 commits into from Feb 19, 2019

Conversation

jeysal
Copy link
Contributor

@jeysal jeysal commented Feb 17, 2019

Summary

migrate jest-resolve-dependencies to TypeScript

Test plan

@jeysal
Copy link
Contributor 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.

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 :)

packages/jest-types/src/Snapshot.ts Show resolved Hide resolved
packages/jest-resolve-dependencies/src/index.ts Outdated Show resolved Hide resolved
});
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
Contributor 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!

@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.

None yet

4 participants