Skip to content

docs: fix reporter configuration pattern in all documentation#24

Merged
prosdev merged 1 commit into
mainfrom
docs/fix-reporter-config-pattern
Dec 10, 2025
Merged

docs: fix reporter configuration pattern in all documentation#24
prosdev merged 1 commit into
mainfrom
docs/fix-reporter-config-pattern

Conversation

@prosdev
Copy link
Copy Markdown
Contributor

@prosdev prosdev commented Dec 10, 2025

Summary

Fixes the incorrect reporter configuration examples throughout the documentation.

Problem

The documentation showed an incorrect pattern that doesn't work with Playwright:

// ❌ WRONG - Playwright doesn't accept class instances
export default {
  reporter: [
    ['list'],
    [new CoreReporter({ adapters: [...] })]
  ]
};

Solution

Updated all documentation to show the correct pattern (matching how lytics-playwright actually uses it):

// reporter.ts - Create a file that exports a class
class CustomReporter extends CoreReporter {
  constructor() {
    super({ adapters: [...] });
  }
}
export default CustomReporter;
// playwright.config.ts - Reference by file path
export default {
  reporter: [['list'], ['./reporter.ts']]
};

Files Changed

  • README.md (root)
  • packages/reporter/README.md
  • packages/reporter/src/CoreReporter.ts (JSDoc)
  • packages/reporter/src/index.ts (JSDoc)
  • packages/adapters/README.md
  • packages/adapters/src/index.ts (JSDoc)
  • packages/annotations/README.md
  • website/content/index.mdx
  • website/content/docs/quickstart.mdx
  • website/content/docs/reporter/index.mdx
  • website/content/docs/reporter/usage.mdx
  • website/content/docs/annotations/index.mdx
  • website/content/docs/adapters/*.mdx (all adapter docs)

Testing

  • pnpm build passes
  • pnpm typecheck passes

No code changes - documentation only.

Playwright reporters must be specified as file paths, not class instances.
Updated all documentation and JSDoc to show the correct pattern:

1. Create a reporter file that extends CoreReporter
2. Reference it by path in playwright.config.ts

This matches how lytics-playwright actually uses the reporter.
@prosdev prosdev force-pushed the docs/fix-reporter-config-pattern branch from 7bcd991 to e9b4221 Compare December 10, 2025 09:35
@prosdev prosdev merged commit f94db14 into main Dec 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants