def METHOD_NAME(test_dir: str, files: Iterable[str]) -> List[str]:
    test_files = []
    for file in files:
        file = min(
            (
                os.path.join(test_dir, file_name)
                for file_name in os.listdir(test_dir)
                if file_name.startswith(file)
            ),
            default=file,
        )
        if not os.path.isfile(file):
            raise Exception(f"Cannot find a matching file for '{file}' in '{test_dir}'")
        test_files.append(os.path.abspath(file))
    if not test_files:
        test_files = sorted(
            glob.glob(os.path.join(test_dir, "*.ts")) + glob.glob(os.path.join(test_dir, "*.js"))
        )
    return test_files