( pluginSlug: string, outputDir: string, runnerResult: RunnerResult, )
| 121 | * @param outputDir |
| 122 | */ |
| 123 | export async function writeRunnerResults( |
| 124 | pluginSlug: string, |
| 125 | outputDir: string, |
| 126 | runnerResult: RunnerResult, |
| 127 | ): Promise<void> { |
| 128 | const cacheFilePath = getRunnerOutputsPath(pluginSlug, outputDir); |
| 129 | await ensureDirectoryExists(path.dirname(cacheFilePath)); |
| 130 | await writeFile(cacheFilePath, JSON.stringify(runnerResult.audits, null, 2)); |
| 131 | logger.info( |
| 132 | `Wrote runner output to cache ${formatCachePathSuffix(cacheFilePath)}`, |
| 133 | ); |
| 134 | } |
| 135 | |
| 136 | export async function readRunnerResults( |
| 137 | pluginSlug: string, |
no test coverage detected