Skip to content

Commit

Permalink
[CI] Correctly resolve repository root for JUnit reports (#80226) (#8…
Browse files Browse the repository at this point in the history
…0234)

Signed-off-by: Tyler Smalley <[email protected]>
  • Loading branch information
Tyler Smalley authored Oct 13, 2020
1 parent dac9c4d commit a69d8d8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/kbn-test/src/jest/junit_reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { writeFileSync, mkdirSync } from 'fs';

import xmlBuilder from 'xmlbuilder';

import { REPO_ROOT } from '@kbn/utils';
import type { Config } from '@jest/types';
import { AggregatedResult, Test, BaseReporter } from '@jest/reporters';

Expand All @@ -46,7 +47,7 @@ export default class JestJUnitReporter extends BaseReporter {
constructor(globalConfig: Config.GlobalConfig, { rootDirectory, reportName }: ReporterOptions) {
super();
this._reportName = reportName || 'Jest Tests';
this._rootDirectory = rootDirectory ? resolve(rootDirectory) : resolve(__dirname, '../..');
this._rootDirectory = rootDirectory ? resolve(rootDirectory) : REPO_ROOT;
}

/**
Expand Down

0 comments on commit a69d8d8

Please sign in to comment.