JSPM

flakewatch-core

0.1.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 13
  • Score
    100M100P100Q54506F
  • License MIT

Core logic for flakewatch: failure grouping, context packaging, LLM interface

Package Exports

  • flakewatch-core

Readme

flakewatch-core

Core logic for Flakewatch -- AI-powered Playwright test failure triage.

This package contains the shared libraries used by the CLI, reporter, browser agent, and GitHub Action. Most users should use flakewatch (CLI) or flakewatch-playwright (reporter) instead of this package directly.

What's inside

  • Config -- loading, validation, and defaults
  • Context -- packaging test failures with source code, page objects, error info, and screenshots
  • Grouping -- clustering failures by normalized error signature
  • LLM -- Anthropic client with verdict-focused system prompt
  • Verdicts -- type definitions for all verdict types
  • Reporting -- Markdown, JSON, and GitHub comment output
  • Triage -- the main pipeline that groups, investigates, and reports

Usage

import {
  loadConfig,
  triageFailures,
  formatMarkdownReport,
  parsePlaywrightJsonReport,
} from 'flakewatch-core';

const config = await loadConfig();
const { failures, totalTests } = parsePlaywrightJsonReport(jsonReport);

const report = await triageFailures({ failures, totalTests, config });
console.log(formatMarkdownReport(report));

License

MIT