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
Collaborator

jeysal commented Feb 17, 2019

Summary

migrate jest-resolve-dependencies to TypeScript

Test plan

@jeysal

This comment has been minimized.

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

This comment has been minimized.

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 jeysal:ts-resolve-dependencies branch from 0c16175 to b60516f Feb 18, 2019
@SimenB
SimenB approved these changes Feb 19, 2019
Copy link
Collaborator

SimenB left a comment

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) => {

This comment has been minimized.

Copy link
@SimenB

SimenB Feb 19, 2019

Collaborator

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

This comment has been minimized.

Copy link
@jeysal

jeysal Feb 19, 2019

Author Collaborator

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

This comment has been minimized.

Copy link
@SimenB

SimenB Feb 19, 2019

Collaborator

sounds good!

@jeysal jeysal force-pushed the jeysal:ts-resolve-dependencies branch from 95553b0 to bc96e8b Feb 19, 2019
@SimenB SimenB merged commit b8a9a71 into facebook:master Feb 19, 2019
12 checks passed
12 checks passed
ci/circleci: lint-and-typecheck Your tests passed on CircleCI!
Details
ci/circleci: test-browser Your tests passed on CircleCI!
Details
ci/circleci: test-jest-circus Your tests passed on CircleCI!
Details
ci/circleci: test-node-10 Your tests passed on CircleCI!
Details
ci/circleci: test-node-11 Your tests passed on CircleCI!
Details
ci/circleci: test-node-6 Your tests passed on CircleCI!
Details
ci/circleci: test-node-8 Your tests passed on CircleCI!
Details
ci/circleci: test-or-deploy-website Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
deploy/netlify Deploy preview ready!
Details
facebook.jest #20190219.15 succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.