Skip to content

Commit cc75e96

Browse files
committed
fix: resolve path to xml
1 parent bef1293 commit cc75e96

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/commands/apex-code-coverage/transformer/transform.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ export default class TransformerTransform extends SfCommand<TransformerTransform
4444
public async run(): Promise<TransformerTransformResult> {
4545
const { flags } = await this.parse(TransformerTransform);
4646
let jsonFilePath = flags['coverage-json'];
47-
const xmlFilePath = flags['xml'];
47+
let xmlFilePath = flags['xml'];
4848
const dxDirectory = flags['dx-directory'];
4949
jsonFilePath = path.resolve(jsonFilePath);
50+
xmlFilePath = path.resolve(xmlFilePath);
5051
// Check if the JSON file exists
5152
if (!fs.existsSync(jsonFilePath)) {
5253
this.error(`JSON file does not exist: ${jsonFilePath}`);

test/commands/transformer/unit.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import * as path from 'node:path';
2+
13
import { TestContext } from '@salesforce/core/lib/testSetup.js';
24
import { expect } from 'chai';
35
import { stubSfCommandUx } from '@salesforce/sf-plugins-core';
@@ -6,8 +8,10 @@ import TransformerTransform from '../../../src/commands/apex-code-coverage/trans
68
describe('transform the code coverage json', () => {
79
const $$ = new TestContext();
810
let sfCommandStubs: ReturnType<typeof stubSfCommandUx>;
9-
const testJsonPath = 'test.json';
10-
const testXmlPath = 'coverage.xml';
11+
let testJsonPath = 'test.json';
12+
let testXmlPath = 'coverage.xml';
13+
testJsonPath = path.resolve(testJsonPath);
14+
testXmlPath = path.resolve(testXmlPath);
1115

1216
beforeEach(() => {
1317
sfCommandStubs = stubSfCommandUx($$.SANDBOX);

0 commit comments

Comments
 (0)