Skip to content
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

Detect and warn when async function is passed to module() #1600

Closed
Krinkle opened this issue Apr 23, 2021 · 0 comments
Closed

Detect and warn when async function is passed to module() #1600

Krinkle opened this issue Apr 23, 2021 · 0 comments
Assignees
Labels
Component: Core For module, test, hooks, and reporters. Type: Enhancement New idea or feature request.
Milestone

Comments

@Krinkle
Copy link
Member

Krinkle commented Apr 23, 2021

Tip

For async module setup, use hooks. https://qunitjs.com/api/QUnit/module/#hooks


As discussed in #1597.

Warning in QUnit 2.x, and later fail with error in QUnit 3.0.

@Krinkle Krinkle added Type: Enhancement New idea or feature request. Component: Core For module, test, hooks, and reporters. labels Apr 23, 2021
@Krinkle Krinkle added this to the 3.0 release milestone Apr 23, 2021
@Krinkle Krinkle changed the title Detect and fail when async function is passed to module() Detect and warn when async function is passed to module() Apr 23, 2021
@Krinkle Krinkle modified the milestones: 3.0 release, 2.x release Apr 23, 2021
@Krinkle Krinkle mentioned this issue Apr 23, 2021
14 tasks
raycohen added a commit to raycohen/qunit that referenced this issue May 16, 2021
raycohen added a commit to raycohen/qunit that referenced this issue May 16, 2021
raycohen added a commit to raycohen/qunit that referenced this issue May 16, 2021
raycohen added a commit to raycohen/qunit that referenced this issue May 24, 2021
@Krinkle Krinkle closed this as completed Jun 7, 2021
Krinkle pushed a commit that referenced this issue Jun 10, 2024
…ule callback

Throw an Error when a module callback has a promise as a return value.

Error early if module callback is an `async function` to avoid its tests from being defined as part of other modules.

Update tests:
* rename CLI test async-module-warning to async-module-error
* rename CLI test async-module-warning-promise to async-module-error-promise
* add main test to verify at runtime (use then-able syntax instead of Promise/async for IE11 compat).

Ref #1600.
Closes #1761.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Core For module, test, hooks, and reporters. Type: Enhancement New idea or feature request.
Development

No branches or pull requests

2 participants