-
Notifications
You must be signed in to change notification settings - Fork 776
Closed
Labels
Component: CoreFor module, test, hooks, and reporters.For module, test, hooks, and reporters.Type: EnhancementNew idea or feature request.New idea or feature request.
Milestone
Description
When a user forgets to provide the hooks param in a module callback, they may unintentionally install a hook on a different module than is visually indicated, eg:
module('outer', function (hooks) {
test('one', ...);
module('inner a', function () {
hooks.beforeEach(...); // will run before all three tests even though visually nested in "inner a"
test('two', ...);
});
module('inner b', function () {
test('three', ...);
});
});
There is a lint rule for this, but I think it would make sense for QUnit to throw an error when this occurs. Is there any reason a user would want to do this intentionally?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Component: CoreFor module, test, hooks, and reporters.For module, test, hooks, and reporters.Type: EnhancementNew idea or feature request.New idea or feature request.