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

Add example docs for getDebugInfo #1168

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions addon-test-support/@ember/test-helpers/-internal/debug-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,20 @@ export function backburnerDebugInfoAvailable() {

/**
* Retrieves debug information from backburner's current deferred actions queue (runloop instance).
* The debug info returned includes details about anything that is currently unsettled (e.g. timers,
* pending test waiters, etc).
*
* If the `getDebugInfo` method isn't available, it returns `null`.
*
* @example
*
* ```js
* import { getDebugInfo } from '@ember/test-helpers';
*
* // ...snip...
* getDebugInfo().toConsole();
Comment on lines +68 to +71
Copy link
Contributor

@scalvert scalvert Dec 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is quite right. Calling getDebugInfo returns the inner debug info from backburner's getDebugInfo.

The TestDebugInfo class has the toConsole method on it, which is what getSettledState returns in its result. That's different than this.

* ```
*
* @public
* @returns {MaybeDebugInfo | null} Backburner debugInfo or, if the getDebugInfo method is not present, null
*/
Expand Down