Skip to content

Commit

Permalink
docs: fix examples for linkPartialObjects methods (#5255)
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd authored Nov 16, 2024
1 parent d3b2c38 commit 34e0e52
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions lib/nodejs/parallel-buffered-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 34e0e52

Please sign in to comment.