Skip to content

Conversation

@lraveri
Copy link

@lraveri lraveri commented Jan 28, 2026

The “Expecting tests to fail” section uses it() before the documentation explains that it() is an alias of test().

This reorders the relevant documentation sections so that the describe() / it() aliases are introduced before being used, improving readability for first-time readers.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/test_runner

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to the documentations. test_runner Issues and PRs related to the test runner subsystem. labels Jan 28, 2026
Copy link
Member

@JakobJingleheimer JakobJingleheimer left a comment

Choose a reason for hiding this comment

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

I presume this is a cut-paste

@lraveri
Copy link
Author

lraveri commented Jan 28, 2026

I presume this is a cut-paste

yep, it is

@lraveri lraveri force-pushed the doc/reorder-test-doc-sections branch from 48eeed9 to 4c1db7d Compare January 28, 2026 16:58
@lraveri lraveri changed the title docs: move describe/it aliases section before expectFailure doc: move describe/it aliases section before expectFailure Jan 28, 2026
@vassudanagunta
Copy link
Contributor

I think clarity would be better served by keeping all the flag options for test together: skip, todo, expectFailure, only.

IMHO one of the following:

  • change the example for expectFailure to use test instead of it. The consistency with the examples for skip and todo makes it easier to learn.

  • if it and describe are so common that the learner should get used to them, then move the describe/it aliases section to the top. Then examples for other features can use either.

@JakobJingleheimer
Copy link
Member

Let's write a proposal for it (in the nodejs/test_runner repo)

@JakobJingleheimer
Copy link
Member

Ack, sorry. My request for a proposal was meant for a different expectFailure thread (the one about expectFailure: message) 🤦‍♂️

I think clarity would be better served by keeping all the flag options for test together: skip, todo, expectFailure, only.

I think this is probably better (and move describe & it above them).

@lraveri
Copy link
Author

lraveri commented Jan 29, 2026

Ack sorry. My request for a proposal was meant for a different test-runner thread 🤦‍♂️ (the one about expectFail: message).

No worries. I think @vassudanagunta is right and we can change the example for expectFailure to use test instead of it and move the describe / it section where it was before.

WDYT? @JakobJingleheimer

@JakobJingleheimer
Copy link
Member

I think either is fine, but regardless of it vs test, do keep the flags together in the docs.

I think it's slightly better to use it & describe because it's more obvious which is what than nested tests

Signed-off-by: Luca Raveri <lucaraveri993@gmail.com>
@lraveri
Copy link
Author

lraveri commented Jan 29, 2026

Ok, I moved the it / describe section up and grouped the flag sections together.

Here the final structure:

image

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

Labels

doc Issues and PRs related to the documentations. test_runner Issues and PRs related to the test runner subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants