use lastRunFile from config when defined

This commit is contained in:
Mathias Leppich 2024-09-09 18:32:03 +02:00
parent 7dab70c660
commit b0e57454f2

View file

@ -80,7 +80,7 @@ export async function createReporters(config: FullConfigInternal, mode: 'list' |
if (!isTestServer && (mode === 'test' || mode === 'merge')) {
// If we are not in the test server, always add a last-run reporter.
const lastRunOutputFile = config.projects.length >= 0 ? path.join(config.projects[0].project.outputDir, '.last-run.json') : undefined;
const lastRunOutputFile = config.lastRunFile ?? config.projects.length >= 0 ? path.join(config.projects[0].project.outputDir, '.last-run.json') : undefined;
reporters.push(new LastRunReporter({ ...runOptions, outputFile: lastRunOutputFile }));
}