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

test: adding more tests for strip-types #54929

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kevinuehara
Copy link

In this MR I'm adding more tests created in this PR, testing generics and Utility Types.
This PR makes part of typescript iniciative on Node.

cc: @RedYetiDev @marco-ippolito @ErickWendel

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/typescript

@nodejs-github-bot nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. strip-types Issues or PRs related to strip-types support test Issues and PRs related to the tests. labels Sep 13, 2024
test/es-module/test-typescript.mjs Outdated Show resolved Hide resolved
test/es-module/test-typescript.mjs Outdated Show resolved Hide resolved
@RedYetiDev RedYetiDev added the commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. label Sep 13, 2024
@marco-ippolito
Copy link
Member

Again commits do not point to your github profile or email

@RedYetiDev
Copy link
Member

Again commits do not point to your github profile or email

The commits point to Kevin Uehara <kevin.uehara@ifood.com.br>, whereas your github profile's commits point to Gayathri <gayathriraj.vlr@gmail.com>

@kevinuehara kevinuehara force-pushed the kevinuehara/adding-typescript-tests branch from 0d4dde4 to e1fbc08 Compare September 13, 2024 21:16
@kevinuehara
Copy link
Author

kevinuehara commented Sep 13, 2024

@marco-ippolito @RedYetiDev I update the author of commits... the ifood account is my work author :)

@RedYetiDev
Copy link
Member

@marco-ippolito how does this fixture compare to the other ones? Just want to make sure they are all similar

@marco-ippolito
Copy link
Member

marco-ippolito commented Sep 19, 2024

To be honest I dont think there is much value in testing TypeScript features such as Unions and Generics, since we rely on swc and swc tests that the output they produce is correct. Im ok with asserting that parameter properties throw in striptypes mode

@kevinuehara
Copy link
Author

@marco-ippolito @RedYetiDev Do you think we can approve and merge this PR?

@marco-ippolito marco-ippolito added the request-ci Add this label to start a Jenkins CI on a PR. label Sep 23, 2024
@github-actions github-actions bot removed the request-ci Add this label to start a Jenkins CI on a PR. label Sep 23, 2024
@nodejs-github-bot
Copy link
Collaborator

@RedYetiDev RedYetiDev added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 23, 2024
@kevinuehara kevinuehara force-pushed the kevinuehara/adding-typescript-tests branch from ccfa065 to f5ef1e0 Compare September 23, 2024 14:39
Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

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

LGTM

@kevinuehara kevinuehara force-pushed the kevinuehara/adding-typescript-tests branch from 99a7b21 to 5c4f180 Compare September 23, 2024 14:52
@kevinuehara
Copy link
Author

kevinuehara commented Sep 23, 2024

@RedYetiDev can you review and approve the PR? 🙏

@RedYetiDev
Copy link
Member

RedYetiDev commented Sep 23, 2024

@RedYetiDev can you review and approve the PR? 🙏

I'm not a core collaborator, so my reviews have no approving power. But, LGTM.

@RedYetiDev RedYetiDev removed their request for review September 23, 2024 14:58
@kevinuehara
Copy link
Author

@RedYetiDev can you review and approve the PR? 🙏

I'm not a core collaborator, so my reviews have no approving power. But, LGTM.

Thanks!! Now who can merge the PR?

@RedYetiDev
Copy link
Member

It's been labelled author ready. A maintainer can add commit-queue if they feel confident this should land.

@RedYetiDev RedYetiDev removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 23, 2024
@RedYetiDev
Copy link
Member

RedYetiDev commented Sep 23, 2024

@kevinuehara can you rebase/squash the merge commit + resolve the lint error?

@kevinuehara
Copy link
Author

@kevinuehara can you rebase/squash the merge commit + resolve the lint error?

Sorry! But can you help me with the rebase/squash the merge coomit? Is there any command to solve the lint problem?

@RedYetiDev
Copy link
Member

  1. make lint-js will lint, while make lint-js-fix will fix some of the errors
  2. git rebase -i HEAD~n, where n represents the number of commits, will open a UI where you can pick / squash commits. See https://www.freecodecamp.org/news/git-squash-commits/

Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.19%. Comparing base (c4681d5) to head (b912d00).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #54929      +/-   ##
==========================================
- Coverage   88.24%   88.19%   -0.06%     
==========================================
  Files         652      650       -2     
  Lines      183880   183352     -528     
  Branches    35858    35704     -154     
==========================================
- Hits       162271   161713     -558     
- Misses      14900    14996      +96     
+ Partials     6709     6643      -66     

see 51 files with indirect coverage changes

@kevinuehara
Copy link
Author

@RedYetiDev I'm having some troube to use the squash/merge... I'm thinking to close this PR and open a new one, what do you think?

@RedYetiDev
Copy link
Member

RedYetiDev commented Sep 23, 2024

What's the issue you are having?

git reset --soft HEAD~<n> # where <n> represents the number of commits, in this case, 9
git commit

May also work. (See https://stackoverflow.com/questions/5189560/how-do-i-squash-my-last-n-commits-together)

@kevinuehara
Copy link
Author

What's the issue you are having?

When I use the git rebase -i HEAD~2 all these commits appear due to the update with main:

image

@RedYetiDev
Copy link
Member

RedYetiDev commented Sep 23, 2024

Oh okay. IIRC what you'll want to do is get the latest commit from main, and run

git reset --hard <commit> # Right now it's c237eabf4c8f1d5ff6dfa95ae30930d6fc959d4e

Caution

This is a dangerous command. It'll remove all uncommitted changes, and revert your local workspace to look identical to <commit> (c237eab)

After this, re-add the changes from this PR. This can be done manually, or via git apply path/to/file.diff with the PR's diff file.

Once this is done, you can git add . and git commit

@kevinuehara kevinuehara force-pushed the kevinuehara/adding-typescript-tests branch from 427b202 to 240c9e9 Compare September 23, 2024 18:00
@kevinuehara
Copy link
Author

@RedYetiDev I achieved! Thank you so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. strip-types Issues or PRs related to strip-types support test Issues and PRs related to the tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants