Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DetectionSource ¶ added in v1.2.0
type DetectionSource string
DetectionSource indicates how the framework was detected.
const ( // SourceImport indicates detection via explicit import statement (highest confidence). SourceImport DetectionSource = "import" // SourceConfigScope indicates detection via config file scope. SourceConfigScope DetectionSource = "config-scope" // SourceContentPattern indicates detection via content pattern matching. SourceContentPattern DetectionSource = "content-pattern" // SourceUnknown indicates no framework was detected. SourceUnknown DetectionSource = "unknown" )
type Detector ¶
type Detector struct {
// contains filtered or unexported fields
}
Detector performs framework detection using early-return approach. Detection priority (highest to lowest): 1. Import statements - explicit developer intent (immediate return) 2. Config scope - project-level configuration 3. Content patterns - framework-specific code patterns
The first successful match at any level immediately returns.
func NewDetector ¶
NewDetector creates a new detector.
func (*Detector) Detect ¶
Detect performs framework detection on a test file. Uses early-return: first match wins based on priority.
func (*Detector) SetProjectScope ¶ added in v1.2.0
func (d *Detector) SetProjectScope(scope *framework.AggregatedProjectScope)
SetProjectScope configures the detector with project-wide configuration context.
type Result ¶
type Result struct {
// Framework is the detected framework name (e.g., "jest", "vitest").
// Empty string if no framework detected.
Framework string
// Source indicates how the framework was detected.
Source DetectionSource
// Scope is the config scope that applies to this file (if scope-based detection succeeded).
// May be nil if no config scope applies.
Scope interface{} // framework.ConfigScope, but avoid import cycle
}
Result represents the outcome of framework detection for a test file.
func Confirmed ¶ added in v1.2.0
func Confirmed(framework string, source DetectionSource) Result
Confirmed returns a Result indicating a framework was definitively detected.
func ConfirmedWithScope ¶ added in v1.2.0
ConfirmedWithScope returns a Result with config scope information.
func (Result) IsDetected ¶ added in v1.2.0
IsDetected returns true if a framework was detected.