Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

docs: fix examples for `linkPartialObjects` methods (#5255)

Linda_pp34e0e52e047a
diff --git a/lib/nodejs/parallel-buffered-runner.js b/lib/nodejs/parallel-buffered-runner.js
index 6052efc0..dfe8cfad 100644
--- a/lib/nodejs/parallel-buffered-runner.js
+++ b/lib/nodejs/parallel-buffered-runner.js
@@ -374,16 +374,16 @@ class ParallelBufferedRunner extends Runner {
* // this reporter needs proper object references when run in parallel mode
* class MyReporter() {
* constructor(runner) {
- * this.runner.linkPartialObjects(true)
+ * runner.linkPartialObjects(true)
* .on(EVENT_SUITE_BEGIN, suite => {
- // this Suite may be the same object...
- * })
- * .on(EVENT_TEST_BEGIN, test => {
- * // ...as the `test.parent` property
- * });
- * }
- * }
- */
+ * // this Suite may be the same object...
+ * })
+ * .on(EVENT_TEST_BEGIN, test => {
+ * // ...as the `test.parent` property
+ * });
+ * }
+ * }
+ */
linkPartialObjects(value) {
this._linkPartialObjects = Boolean(value);
return super.linkPartialObjects(value);
diff --git a/lib/runner.js b/lib/runner.js
index 60a19f0e..ad318434 100644
--- a/lib/runner.js
+++ b/lib/runner.js
@@ -1116,11 +1116,11 @@ Runner.prototype.run = function (fn, opts = {}) {
* @public
* @example
* // this reporter needs proper object references when run in parallel mode
- * class MyReporter() {
+ * class MyReporter {
* constructor(runner) {
- * this.runner.linkPartialObjects(true)
+ * runner.linkPartialObjects(true)
* .on(EVENT_SUITE_BEGIN, suite => {
- // this Suite may be the same object...
+ * // this Suite may be the same object...
* })
* .on(EVENT_TEST_BEGIN, test => {
* // ...as the `test.parent` property