-
-
Notifications
You must be signed in to change notification settings - Fork 259
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
Document all the things... #291
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Stores the provided application instance so that tests being ran will be aware of the application under test. | ||
|
||
Required by `setupApplicationContext` method. | ||
Used by `setupContext` and `setupRenderingContext` when present. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use -
prefixes here to make that a markdown list?
let { tagName, type } = el; | ||
/** | ||
@private | ||
@method isFormControl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw with documentation
the @method
attribute is inferred from the function name, so this is not necessarily needed afaik
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, should I remove it across the board?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you might want to verify my statement, but unless you see any additional value in having the function name repeated here I see no reason for keeping them
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, just confirmed. Neither documentation
nor eslint
need the @method
.
/** | ||
@private | ||
@method __click__ | ||
@param {Element} element the element to trigger events on |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description sounds like it was copy pasted from another function... 😉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, it seems correct to me? The element
arg is the thing we trigger all the various events (focusin, focus, click, etc) on...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, though "trigger events on" sounds like something that the description for triggerEvent()
should say, not necessarily the docs for click()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, a “click” is actually many events 🤔
But either way, I take your point. I should also make that clearer in the click docs too.
@method settled | ||
@returns {Promise<void>} resolves when settled | ||
*/ | ||
export default function settled() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unrelated to this PR but I'm wondering if we should implement this using waitUntil()
and moving the backoff algorithm into waitUntil()
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I had the same thought actually. Will work on that after these changes have landed.
setupRenderingTest(hooks); | ||
|
||
test('does something awesome', function(assert) { | ||
render(hbs`{{awesome-sauce}}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this example is not using async/await, which seems a little strange as it's the default now 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agreed. Will update.
@@ -38,6 +95,12 @@ export function pauseTest() { | |||
return context.pauseTest(); | |||
} | |||
|
|||
/** | |||
Resumes a test previously paused by `return pauseTest()`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer await pauseTest()
since return pauseTest()
will make resumeTest()
essentially impossible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 will update
let result = validateErrorHandler(); | ||
assert.ok(result.isValid, result.message); | ||
}); | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer it if the @example
block would be moved below the function signature documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally agreed. Will update.
Includes a small tweak to the implementation (no longer receives an object)...
Kept as "private" for now, but we intend to make it public in a future PR...
Also make `@method` show up as a linting error (though you _could_ use `@do-not-use-redundant-method-tag methodNameHere` but that seems _obviously wrong and easy to spot in PR review).
Also makes it clear that the specific list of fired events may change over time as needed.
Also use alternate JSDoc style with prefixed `*` on each line. Without this the indentation of the example block is lost.
Adds API documentation for all public APIs (and some private ones).
Also enables the
require-jsdoc
eslint rule to ensure all functions are documented going forward...Closes #285