Skip to content

Setting a timeout to a describe does not have an effect in 0.31 #3454

@marcus13371337

Description

@marcus13371337

Describe the bug

It seems as if something broke when upgrading from 0.30.1 to 0.31.1 with the test timeouts. Passing { timeout: XXX } to describe does not have an effect any longer, the default testTimeout is always used.

Reproduction

Run the foll

Short description:

describe(
  "the submitted issue",
  () => {
    test("true is true after 10s", async () => {
      await new Promise((resolve) => setTimeout(resolve, 10000));

      expect(true).toBe(true);
    });
  },
  {
    timeout: 30000,
  }
);

I'm expecting the test to pass after approx 10s instead it fails after 5s with the error:

Error: Test timed out in 5000ms.
If this is a long-running test, pass a timeout value as the last argument or configure it globally with "testTimeout".

System Info

System:
    OS: macOS 13.4
    CPU: (12) arm64 Apple M2 Max
    Memory: 52.25 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node
    npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm
  Browsers:
    Chrome: 113.0.5672.126
    Safari: 16.5
  npmPackages:
    @vitest/coverage-istanbul: ^0.31.1 => 0.31.1
    vite: ^4.3.9 => 4.3.9
    vitest: ^0.31.1 => 0.31.1

Used Package Manager

pnpm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions