Skip to content

Conversation

@koh110
Copy link
Contributor

@koh110 koh110 commented Jul 14, 2023

  • add setup and watch options

The implementation of the setup function includes arguments, but the Node.js documentation does not provide any description of the argument types.
https://nodejs.org/docs/latest-v20.x/api/test.html#runoptions
https://github.com/nodejs/node/blob/v20.4.0/lib/internal/test_runner/runner.js#L510
https://github.com/nodejs/node/blob/v20.4.0/lib/internal/test_runner/harness.js#L29-L31


Please fill in this template.

If changing an existing definition:

@typescript-bot
Copy link
Contributor

typescript-bot commented Jul 14, 2023

@koh110 Thank you for submitting this PR!

This is a live comment which I will keep updated.

1 package in this PR

Code Reviews

Because this is a widely-used package, a DT maintainer will need to review it before it can be merged.

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 a DT maintainer

All of the items on the list are green. To merge, you need to post a comment including the string "Ready to merge" to bring in your changes.

Inactive

This PR has been inactive for 11 days — please merge or say something if there's a problem, otherwise it will be closed!


Diagnostic Information: What the bot saw about this PR
{
  "type": "info",
  "now": "-",
  "pr_number": 66064,
  "author": "koh110",
  "headCommitOid": "31034ca619357d13e9292010acaa0f0409803d48",
  "mergeBaseOid": "77b183c95be2dc99f7399c54c4860f312a456ca8",
  "lastPushDate": "2023-07-14T08:41:49.000Z",
  "lastActivityDate": "2023-08-05T10:14:10.000Z",
  "mergeOfferDate": "2023-07-24T19:26:16.000Z",
  "mergeRequestDate": "2023-08-04T01:06:58.000Z",
  "mergeRequestUser": "koh110",
  "hasMergeConflict": false,
  "isFirstContribution": false,
  "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"
        },
        {
          "path": "types/node/ts4.8/test.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/ts4.8/test/test.ts",
          "kind": "test"
        },
        {
          "path": "types/node/v18/test.d.ts",
          "kind": "definition"
        },
        {
          "path": "types/node/v18/test/test.ts",
          "kind": "test"
        }
      ],
      "owners": [
        "Microsoft",
        "DefinitelyTyped",
        "jkomyno",
        "alvis",
        "r3nya",
        "btoueg",
        "smac89",
        "touffy",
        "DeividasBakanas",
        "eyqs",
        "Hannes-Magnusson-CK",
        "hoo29",
        "kjin",
        "ajafff",
        "islishude",
        "mwiktorczyk",
        "mohsen1",
        "n-e",
        "galkin",
        "parambirs",
        "eps1lon",
        "SimonSchick",
        "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": "approved",
      "reviewer": "rbuckton",
      "date": "2023-07-24T19:25:31.000Z",
      "isMaintainer": true
    },
    {
      "type": "stale",
      "reviewer": "Semigradsky",
      "date": "2023-07-17T08:41:33.000Z",
      "abbrOid": "5a92bf3"
    }
  ],
  "mainBotCommentID": 1635514806,
  "ciResult": "pass"
}

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

@typescript-bot typescript-bot added The CI failed When GH Actions fails and removed Untested Change This PR does not touch tests labels Jul 14, 2023
@typescript-bot
Copy link
Contributor

@koh110 The CI build failed! Please review the logs for more information.

Once you've pushed the fixes, the build will automatically re-run. Thanks!

Note: builds which are failing do not end up on the list of PRs for the DT maintainers to review.

@typescript-bot typescript-bot removed the The CI failed When GH Actions fails label Jul 14, 2023
/**
* A function that accepts the TestsStream instance and can be used to setup listeners before any tests are run.
*/
setup?: (root: unknown) => void | Promise<void>;
Copy link
Contributor

Choose a reason for hiding this comment

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

setup?: (testsStream: TestsStream) => void | Promise<void>;

From doc:

A function that accepts the TestsStream instance

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked and it seems that the implementation is not TestStream but Test class.
https://github.com/nodejs/node/blob/v20.4.0/lib/internal/test_runner/harness.js#L29-L31
https://github.com/nodejs/node/blob/v20.4.0/lib/internal/test_runner/test.js#L165-L192
https://github.com/nodejs/node/blob/v20.4.0/lib/internal/test_runner/tests_stream.js#L10

const stream = run({
  files: files,
  concurrency: true,
  setup: function (root) {
    console.log('setup', root)
  }
})
setup <ref *1> Test {
  concurrency: 9,
  nesting: 0,
  only: false,
  reporter: TestsStream {
    _readableState: ReadableState {
      objectMode: true,
      highWaterMark: 16,
      buffer: BufferList { head: null, tail: null, length: 0 },
      length: 0,
      pipes: [],
      flowing: null,
      ended: false,
      endEmitted: false,
      reading: false,

Should I create Test class and all property?

Copy link
Contributor

Choose a reason for hiding this comment

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

It can be a bug, I have created nodejs/node#48809

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your creating issue.
I have modified this PR to match the current implementation.
But should I wait until the issue is resolved?

@Semigradsky
Copy link
Contributor

Also please add changes to ts4.8 folder for Typescript<=4.8 and to v18/v18/ts4.8 folders for Node.js 18.x

@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 Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner labels Jul 24, 2023
@typescript-bot
Copy link
Contributor

@koh110: Everything looks good here. I am ready to merge this PR (at 31034ca) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@microsoft, @DefinitelyTyped, @jkomyno, @alvis, @r3nya, @btoueg, @smac89, @Touffy, @DeividasBakanas, @eyqs, @Hannes-Magnusson-CK, @hoo29, @kjin, @ajafff, @islishude, @mwiktorczyk, @mohsen1, @n-e, @galkin, @parambirs, @eps1lon, @SimonSchick, @ThomasdenH, @WilcoBakker, @wwwy3y3, @samuela, @kuehlein, @bhongy, @chyzwar, @trivikr, @yoursunny, @qwelias, @ExE-Boss, @peterblazejewicz, @addaleax, @victorperin, @ZYSzys, @nodejs, @LinusU, @wafuwafu13, @mcollina, @Semigradsky: you can do this too.)

@typescript-bot typescript-bot added the Unmerged The author did not merge the PR when it was ready. label Aug 4, 2023
@typescript-bot
Copy link
Contributor

Re-ping @koh110 / @microsoft, @DefinitelyTyped, @jkomyno, @alvis, @r3nya, @btoueg, @smac89, @Touffy, @DeividasBakanas, @eyqs, @Hannes-Magnusson-CK, @hoo29, @kjin, @ajafff, @islishude, @mwiktorczyk, @mohsen1, @n-e, @galkin, @parambirs, @eps1lon, @SimonSchick, @ThomasdenH, @WilcoBakker, @wwwy3y3, @samuela, @kuehlein, @bhongy, @chyzwar, @trivikr, @yoursunny, @qwelias, @ExE-Boss, @peterblazejewicz, @addaleax, @victorperin, @ZYSzys, @nodejs, @LinusU, @wafuwafu13, @mcollina, @Semigradsky:

This PR has been ready to merge for over a week, and I haven't seen any requests to merge it. I will close it on Aug 23rd (in three weeks) if this doesn't happen.

(If there's no reason to avoid merging it, please do so. Otherwise, if it shouldn't be merged or if it needs more time, please close it or turn it into a draft.)

@koh110
Copy link
Contributor Author

koh110 commented Aug 4, 2023

Ready to merge

@peterblazejewicz
Copy link
Member

note: edited comment to kick the bot str matcher

@typescript-bot typescript-bot merged commit ec806aa into DefinitelyTyped:master Aug 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Critical package Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner Unmerged The author did not merge the PR when it was ready.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants