Skip to content

Support global test-level setup/teardown callbacks #633

@jzaefferer

Description

@jzaefferer

As originally discussed in #471, it is useful to have setup and teardown callbacks for each test that can be defined globally. For example, in ember the monkey-patching of QUnit.module could be replaced.

As an API I'm suggesting a simple property assignment. This ensures that there is only one place to do this (avoid scattering global setup/teardown across files) and it can be disabled (set to null):

QUnit.config.setup = function() {};
QUnit.config.teardown = function() {};

This would be simple to document as part of QUnit.config.

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions