Skip to content

Commit

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

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

Signed-off-by: Miki <[email protected]>
Signed-off-by: Sergey Osipov <[email protected]>
  • Loading branch information
AMoo-Miki authored and sipopo committed Dec 16, 2022
1 parent 8773686 commit 1675b91
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

- [Multi DataSource] Add unit test coverage for Update Data source management stack ([#2567](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2567))
- [BWC Tests] Add BWC tests for 2.5.0 ([#2890](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2890))
- Fix incorrect validation of time values in JUnit Reporter ([#2965](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2965))

## [2.x]

Expand Down
5 changes: 3 additions & 2 deletions src/dev/jest/junit_reporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,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 1675b91

Please sign in to comment.