Repository navigation
[node:test] Incorrect SuiteContext description #45641
Copy link
Copy link
Closed
Labels
good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Description
Activity
- addeddocIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.
on Nov 27, 2022 But
TestContextis the first argument:import { test } from 'node:test' test(function(foo) { console.log('First argument: ', foo) console.log('this: ', this) }) > First argument: TestContext {} > this: TestContext {}
- addedtest_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
on Nov 27, 2022 @cjihrig it is simply generated as an object literal
node/lib/internal/test_runner/test.js
Lines 739 to 741 in f8ce911
getRunArgs() { return { ctx: { signal: this.signal, name: this.name }, args: [] }; } I think we should either change the docs to remove the use of
SuiteContextsince it doesn't really exist as a class or update the code to make it an actual class. I think updating the code would be easiest in this case.Reacted by Moshe Atlow- addeddiag-agendaIssues and PRs to discuss during Diagnostics Working Group meetings.Issues and PRs to discuss during Diagnostics Working Group meetings.good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.and removeddocIssues and PRs related to Node.js documentation.Issues and PRs related to Node.js documentation.diag-agendaIssues and PRs to discuss during Diagnostics Working Group meetings.Issues and PRs to discuss during Diagnostics Working Group meetings.
on Nov 29, 2022 - added a commit that references this issue
on Nov 30, 2022 Have added PR for the same @cjihrig
- added a commit that references this issue
on Dec 2, 2022
Metadata
Metadata
Assignees
Labels
good first issueIssues that are suitable for first-time contributors.Issues that are suitable for first-time contributors.test_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
Affected url(/sitelet?url=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2Fs)
https://nodejs.org/docs/latest-v18.x/api/test.html#describename-options-fn
Description of the problem
Docs said that tha callback function in
describe:But in fact
SuiteContextis not the first argument.SuiteContextisthiscontext: