Improve the mochitest doc wrt add_task
Categories
(Testing :: Mochitest, enhancement)
Tracking
(Not tracked)
People
(Reporter: u695164, Unassigned)
References
()
Details
URL = https://firefox-source-docs.mozilla.org/testing/mochitest-plain/faq.html
I think this is a good place to describe that for mochitests the function parameters are slightly different to xpcshell-tests
add_task(testFunc) is possible but not
add_task([condition, ]testFunc)
Something like this could help:
Please use add_task(testFunc).skip(condition)
Comment 2•3 years ago
|
||
I'm not the mochiest expert, but I think that ought to be added to https://firefox-source-docs.mozilla.org/testing/mochitest-plain/index.html#asynchronous-tests since that documents add_task.
Comment 3•3 years ago
|
||
Yeah makes sense to me, maybe in a .. note:: directive.
Updated•3 years ago
|
Comment 4•1 year ago
•
|
||
Just came across this ticket. As a fairly new employee of Mozilla, I was so eager to find out what the function signature is for add_task in our test files. But it appears to be a global variable from somewhere. Would it be worth adding the documentation to the function using JSDoc and allowing us to explicitly import the add_task function into the file like below?
Having an explicit import would not only make it clear which of the add_task functions is being executed. But it would also help with intellisense in our IDE.
e.g.
<!DOCTYPE HTML>
<html>
<body>
<script>
import { add_task } from '../path/to/the/file.js';
add_task(async () => {
// code here
});
</script>
</body>
</html>
Description
•