forcedotcom / salesforcedx-apex

Salesforce Apex Node Library
BSD 3-Clause "New" or "Revised" License
19 stars 25 forks source link

fix(junit): fix locale sensitivity with junit #324

Closed JonnyPower closed 1 year ago

JonnyPower commented 1 year ago

closes #323

What does this PR do?

Changes the start date format util to follow predictable ISO standard

What issues does this PR fix or reference?

323

Functionality Before

Test summary start date was in use locale

Functionality After

Test summary start date is in ISO format so can be used programmatically later by junit reporter

JonnyPower commented 1 year ago

can replicate with this test in junitReporter.test.ts;

  it('should format start time with different locale', () => {
    const modified = { ...testResults };
    modified.summary.testStartTime = `${new Date().toDateString()} ${new Date().toLocaleTimeString(
      'en-CA'
    )}`;
    expect(modified.summary.testStartTime).to.contain('.m.');
    reporter.format(modified);
  });
shetzel commented 1 year ago

We should be able to close this since https://github.com/forcedotcom/salesforcedx-apex/pull/334 was merged. Thanks for your hard work and patience with this @JonnyPower !