-
Notifications
You must be signed in to change notification settings - Fork 778
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error when a hook is invoked inside the wrong module #1576
Comments
Yeah, I agree we could flag this automatically. Basically if hooks are called on during the top-level module('outer', hooks => {
test('one', …);
module('inner a', gizmos => {
gizmos.beforeEach(…);
hooks.beforeEach(…); // will throw Error
test('two', …);
});
}); I'd welcome this change in a PR, to land for QUnit 3. Preferably to first as a warning to land in QUnit 2.x, to aid in migration (or fixing of mistakes) prior to the upgrade. |
Change deprecation warning into an error. Ref qunitjs#1576
Change deprecation warning into an error. Ref qunitjs#1576
Change deprecation warning into an error. Ref qunitjs#1576
Change deprecation warning into an error. Ref qunitjs#1576 Closes qunitjs#1578
Change deprecation warning into an error. Ref qunitjs#1576 Closes qunitjs#1578
Change deprecation warning into an error. Ref #1576 Closes #1578 Co-authored-by: Ray Cohen <[email protected]>
Change deprecation warning into an error. Ref qunitjs#1576 Closes qunitjs#1578
Change deprecation warning into an error. Ref qunitjs#1576 Closes qunitjs#1578
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: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?
The text was updated successfully, but these errors were encountered: