Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/utils/dateUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ export function getCurrentTime(): number {
/**
* Returns the formatted date and time given the milliseconds in numbers or UTC formatted string
* @param startTime start time in millisecond numbers or UTC format string
* @returns date and time formatted for locale
* @returns date as ISO string
*/
export function formatStartTime(startTime: string | number): string {
const date = new Date(startTime);
return `${date.toDateString()} ${date.toLocaleTimeString()}`;
return `${date.toISOString()}`;
}

export function msToSecond(timestamp: string | number): string {
Expand Down
2 changes: 1 addition & 1 deletion test/reporters/testResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ApexTestResultOutcome, TestResult } from '../../src/tests/types';

const testStartTime = '2020-11-09T18:02:50.000+0000';
const date = new Date(testStartTime);
const localStartTime = `${date.toDateString()} ${date.toLocaleTimeString()}`;
const localStartTime = `${date.toISOString()}`;

export const coverageResult: TestResult = {
summary: {
Expand Down
2 changes: 1 addition & 1 deletion test/tests/testData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export const syncTestResultWithFailures: SyncTestResult = {

export const testStartTime = '2020-11-09T18:02:50.000+0000';
const date = new Date(testStartTime);
const localStartTime = `${date.toDateString()} ${date.toLocaleTimeString()}`;
const localStartTime = `${date.toISOString()}`;
export const testRunId = '707xx0000AGQ3jbQQD';

export const syncResult: TestResult = {
Expand Down