Skip to content

Latest commit

 

History

History
41 lines (24 loc) · 1.26 KB

no-reset.md

File metadata and controls

41 lines (24 loc) · 1.26 KB

Disallow QUnit.reset (qunit/no-reset)

💼 This rule is enabled in the ✅ recommended config.

Early versions of QUnit exposed the QUnit.reset() function, which allowed consumers to invoke the internal QUnit fixture reset logic. This has been discouraged for a long time since QUnit now automatically invokes this method between tests. In QUnit 2.0, the function will be removed from the public API. Tests that rely on this functionality will need to be split into multiple tests.

This rule will detect and report calls to QUnit.reset().

Rule Details

The following patterns are considered warnings:

QUnit.reset();

The following patterns are not warnings:

QUnit.reset;  // Only attempting to invoke the function is reported

When Not To Use It

This rule can be disabled if there are tests that rely on this functionality and there are no plans to migrate to QUnit 2.0. For the other 99.9% of use cases, use of this rule is highly recommended.

Further Reading