function resolveTargetedFiles
resolveTargetedFiles(
config: Config,
allFiles: string[]
): Promise<TargetedFile[]>

Resolves each file#34 input into the selectors for that file, dropping targets whose file is no longer in the run (a glob, --changed or --only-failed may have filtered it out) and those that resolved to nothing — both fall back to running the file whole, which is what a null selectors means. Every warning is surfaced; a line target that quietly did not narrow is worse than one that says so.

import type { Config } from '../../types.ts';
// Defined, not invoked: reads each targeted file to resolve its `#line` selectors.
async function targetsOf(config: Config, allFiles: string[]) {
  return await resolveTargetedFiles(config, allFiles); // [{ file, selectors: [{ module, test }] }]
}

Parameters

config: Config
allFiles: string[]

Return Type

Promise<TargetedFile[]>

Usage

import { resolveTargetedFiles } from "lib/commands/test/grouping.ts";