Skip to content

Commit

Permalink
Fixes incorrect validation of time values in JUnit Reporter (#2965) (#…
Browse files Browse the repository at this point in the history
…2982)

Signed-off-by: Miki <[email protected]>

Signed-off-by: Miki <[email protected]>
(cherry picked from commit a56480b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

# Conflicts:
#	CHANGELOG.md

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 1438f4d commit 0bb9868
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/dev/jest/junit_reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ export default class JestJUnitReporter {
{ skipNullAttributes: true }
);

const msToIso = (ms) => (ms ? new Date(ms).toISOString().slice(0, -5) : undefined);
const msToSec = (ms) => (ms ? (ms / 1000).toFixed(3) : undefined);
const isNumeric = (val) => !isNaN(parseFloat(val)) && isFinite(val);
const msToIso = (ms) => (isNumeric(ms) ? new Date(ms).toISOString().slice(0, -5) : undefined);
const msToSec = (ms) => (isNumeric(ms) ? (ms / 1000).toFixed(3) : undefined);

root.att({
name: 'jest',
Expand Down

0 comments on commit 0bb9868

Please sign in to comment.