playwright-ast-coverage 0.1.3

Static Playwright AST coverage for Next.js App Router routes
1
2
3
4
5
6
7
8
9
10
11
12
use std::path::PathBuf;

pub fn fixture_path(parts: &[&str]) -> PathBuf {
    let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
    path.extend(["tests", "fixtures", "unit"]);
    path.extend(parts);
    path
}

pub fn fixture_source(parts: &[&str]) -> String {
    std::fs::read_to_string(fixture_path(parts)).expect("fixture should be readable")
}