Skip to content

Set a default timeout in QUnit 3.0 #1483

@Krinkle

Description

@Krinkle

Tip

Migration guide has been published at: https://qunitjs.com/api/config/testTimeout/

Rationale

  • Give better feedback by default in the common case of an async test failing or getting stuck. This applies to both the HTML Reporter and QUnit CLI on Node.js (Common case, because inevitably something somewhere might have relied on taking longer than the default timeout we'll come up with, e.g. minutes or hours).
  • Avoid silent failure when using QUnit via require('qunit') without the QUnit CLI, ref Async tests can abruptly stop in standalone Node.js mode #1132. Right now, due to there not being a default timeout, there appears to be nothing preventing Node.js from silently existing the process after a stuck async test.

Research

Subtasks

  • Determine the timeout we're going to use.
  • Improve documentation of config.testTimeout to include an example of how to set this for integrations like karma-qunit, node-qunit-puppeteer and the QUnit CLI since for many users this is likely the first time they are needing to set a configuration option rather than simply loading test files into a test runner.
  • In QUnit 2.x, emit a warning for tests that have no timeout configurred but take longer than our preferred timeout.
  • In QUnit 3.0, enable the timeout by default and remove the warning.

Metadata

Metadata

Assignees

Labels

Component: CoreFor module, test, hooks, and reporters.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions