matchers

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package matchers provides reusable matcher implementations for framework detection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigMatcher

type ConfigMatcher struct {
	// Patterns is a list of config file name patterns to match.
	// These should be exact file names (e.g., "jest.config.js").
	Patterns []string
}

ConfigMatcher matches framework-specific configuration files. For example: "jest.config.js", "vitest.config.ts"

func NewConfigMatcher

func NewConfigMatcher(patterns ...string) *ConfigMatcher

NewConfigMatcher creates a ConfigMatcher for the given config file patterns.

func (*ConfigMatcher) Match

Match evaluates if a signal contains a matching config file.

type ContentMatcher

type ContentMatcher struct {
	// Patterns is a list of regex patterns to match in file content.
	// Patterns should match framework-specific test function calls or syntax.
	Patterns []*regexp.Regexp
}

ContentMatcher matches framework-specific content patterns in test files. For example: "test.describe(" for Playwright, "describe(" for Jest/Vitest with globals.

func NewContentMatcher

func NewContentMatcher(patterns ...*regexp.Regexp) *ContentMatcher

NewContentMatcher creates a ContentMatcher for the given regex patterns.

func NewContentMatcherFromStrings

func NewContentMatcherFromStrings(patterns ...string) *ContentMatcher

NewContentMatcherFromStrings creates a ContentMatcher from regex pattern strings. Panics if any pattern fails to compile (use during initialization only).

func (*ContentMatcher) Match

Match evaluates if a signal contains matching content patterns.

type ImportMatcher

type ImportMatcher struct {
	// Patterns is a list of import path patterns to match.
	// Supports exact matches and prefix matching.
	// Examples: ["vitest", "vitest/"], ["@playwright/test", "@playwright/test/"]
	Patterns []string
}

ImportMatcher matches framework-specific import statements. For example: "import { test } from 'vitest'" matches Vitest.

func NewImportMatcher

func NewImportMatcher(patterns ...string) *ImportMatcher

NewImportMatcher creates an ImportMatcher for the given import patterns.

func (*ImportMatcher) Match

Match evaluates if a signal contains a matching import statement.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL