Skip to content

Should testing style be changed? #5959

@jsumners

Description

@jsumners

PR #5953 proposes changing our test suites to use const { describe, test } = require('node:test') instead of const test = require('node:test'). This seems to have come about through various mentions of the style across a few PRs that contribute to moving us from tap to node:test. As I noted in that PR, PRs are not always reviewed by the whole team and that for such changes we should really have a discussion first to reach a consensus. Thus, I am opening this issue.

@fastify/leads @fastify/core: what are your thoughts on this issue?

Personally, I am not for the change due to:

  1. It feels like a code change for code change sake.
  2. The majority of our code does not use the describe style.
  3. I find the describe style too verbose. I prefer simple tests with a clear title/description.

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionIssues or PRs with this label will never staleinternalsChange that won't impact the surface API.testIssue or pr related to our testing infrastructure.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions