Skip to content

Conversation

@mbarneyjr
Copy link

Please fill in this template.

Select one of these and delete the others:
If changing an existing definition:

@typescript-bot
Copy link
Contributor

typescript-bot commented Nov 15, 2023

@mbarneyjr Thank you for submitting this PR! I see this is your first time submitting to DefinitelyTyped 👋 — I'm the local bot who will help you through the process of getting things through.

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because you edited one package and updated the tests (👏), I can help you merge this PR once someone else signs off on it.

You can test the changes of this PR in the Playground.

Status

  • ✅ No merge conflicts
  • ✅ Continuous integration tests have passed
  • 🕐 Most recent commit is approved by type definition owners or DT maintainers

Once every item on this list is checked, I'll ask you for permission to merge and publish the changes.

Inactive

This PR has been inactive for 31 days — it is considered abandoned, and therefore closed!


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 67420,
  "author": "mbarneyjr",
  "headCommitOid": "dc1ab0060807fc2b958179cb2d59bc3d40bec6a9",
  "mergeBaseOid": "398d563b05acda2c203e5144aefa2cac9500ae33",
  "lastPushDate": "2023-11-15T19:33:43.000Z",
  "lastActivityDate": "2024-01-08T21:43:03.000Z",
  "maintainerBlessed": "Waiting for Code Reviews",
  "hasMergeConflict": false,
  "isFirstContribution": true,
  "tooManyFiles": false,
  "hugeChange": false,
  "popularityLevel": "Critical",
  "pkgInfo": [
    {
      "name": "node",
      "kind": "edit",
      "files": [
        {
          "path": "types/node/test.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/test/test.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "Microsoft",
        "jkomyno",
        "alvis",
        "r3nya",
        "btoueg",
        "smac89",
        "touffy",
        "DeividasBakanas",
        "eyqs",
        "Hannes-Magnusson-CK",
        "hoo29",
        "kjin",
        "ajafff",
        "islishude",
        "mwiktorczyk",
        "mohsen1",
        "n-e",
        "galkin",
        "parambirs",
        "eps1lon",
        "ThomasdenH",
        "WilcoBakker",
        "wwwy3y3",
        "samuela",
        "kuehlein",
        "bhongy",
        "chyzwar",
        "trivikr",
        "yoursunny",
        "qwelias",
        "ExE-Boss",
        "peterblazejewicz",
        "addaleax",
        "victorperin",
        "ZYSzys",
        "NodeJS",
        "LinusU",
        "wafuwafu13",
        "mcollina",
        "Semigradsky"
      ],
      "addedOwners": [],
      "deletedOwners": [],
      "popularityLevel": "Critical"
    }
  ],
  "reviews": [
    {
      "type": "changereq",
      "reviewer": "sheetalkamat",
      "date": "2024-01-08T21:43:03.000Z"
    },
    {
      "type": "stale",
      "reviewer": "Semigradsky",
      "date": "2023-11-16T10:57:41.000Z",
      "abbrOid": "ca5bc39"
    }
  ],
  "mainBotCommentID": 1813142149,
  "ciResult": "pass"
}

@typescript-bot typescript-bot added Critical package Untested Change This PR does not touch tests labels Nov 15, 2023
@typescript-bot
Copy link
Contributor

@typescript-bot typescript-bot removed the Untested Change This PR does not touch tests label Nov 15, 2023
Copy link
Contributor

@Semigradsky Semigradsky left a comment

Choose a reason for hiding this comment

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

In fact, the user is not required to change the implementation to a function with the same signature.

See "mocks an object method" test for example.

@typescript-bot typescript-bot added the Revision needed This PR needs code changes before it can be merged. label Nov 16, 2023
@typescript-bot
Copy link
Contributor

@mbarneyjr One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you!

@mbarneyjr
Copy link
Author

I think it makes sense to use a function with the same signature though, unless there's edge cases I'm not considering/misunderstanding something

When using sinon, the @types/sinon package defines types that use the stubbed/mocked function for arguments to callsFake(), as well as the resolves(), returns(), etc methods, and I've found this very helpful when mocking things throughout my tests. Because I'm forced to return a correct type from my mocks, none of my code breaks due to type errors. This PR is to update the built-in test module's types up to the same level

Is there anything specific you'd like me to change?

@Semigradsky
Copy link
Contributor

Hello! When I added these types I want to make passable all tests from Node.js, some tests mock functions with another signature.

But maybe require same signature make sense, different signature is 'corner case' that can be handled by type assertion. Lets wait what think other contributors.

In any case make sense to change not only mockImplementation*. The functions fn, method, getter, setter also have Implementation type which can be changed to specific F or MockedObject[MethodName].

@typescript-bot typescript-bot removed the Revision needed This PR needs code changes before it can be merged. label Nov 17, 2023
@mbarneyjr
Copy link
Author

Gotcha, thank you! I believe this already worked for fn, but it should now also work for the various ways of calling method (with/without implementation, with { getter: true }/{ setter: true }, etc), as well as the getter and setter functions. It seems to work as expected, but if there's anything missing/incorrect I'm happy to fix. Thanks for considering this PR!

@typescript-bot
Copy link
Contributor

@Semigradsky Thank you for reviewing this PR! The author has pushed new commits since your last review. Could you take another look and submit a fresh review?

@typescript-bot typescript-bot added the Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. label Nov 27, 2023
@typescript-bot
Copy link
Contributor

@typescript-bot
Copy link
Contributor

Copy link
Contributor

@sheetalkamat sheetalkamat left a comment

Choose a reason for hiding this comment

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

@typescript-bot typescript-bot added Revision needed This PR needs code changes before it can be merged. and removed Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. labels Jan 8, 2024
@typescript-bot
Copy link
Contributor

@mbarneyjr One or more reviewers has requested changes. Please address their comments. I'll be back once they sign off or you've pushed new commits. Thank you!

@typescript-bot typescript-bot added the Abandoned This PR had no activity for a long time, and is considered abandoned label Feb 1, 2024
@typescript-bot
Copy link
Contributor

@mbarneyjr I haven't seen any activity on this PR in more than three weeks, and it still has problems that prevent it from being merged. The PR will be closed on Feb 7th (in a week) if the issues aren't addressed.

@typescript-bot
Copy link
Contributor

@mbarneyjr To keep things tidy, we have to close PRs that aren't mergeable and don't have activity in the last month. No worries, though — please open a new PR if you'd like to continue with this change. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Abandoned This PR had no activity for a long time, and is considered abandoned Critical package Revision needed This PR needs code changes before it can be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants