Skip to content

Commit

Permalink
DEVPROD-820 Support displaying sub 1s durations on the tests table (e…
Browse files Browse the repository at this point in the history
  • Loading branch information
khelif96 authored Dec 12, 2023
1 parent 00fdf3d commit 7fe0958
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/utils/string/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const msToDuration = (ms: number): string => {
if (seconds > 0) {
return `${seconds}s`;
}
return `${ms}ms`;
};

/**
Expand Down
4 changes: 4 additions & 0 deletions src/utils/string/string.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ describe("msToDuration", () => {
const ms = 25000;
expect(msToDuration(ms)).toBe("25s");
});
it("does not convert milli < 1s", () => {
const ms = 500;
expect(msToDuration(ms)).toBe("500ms");
});
});

describe("sortFunctionDate", () => {
Expand Down

0 comments on commit 7fe0958

Please sign in to comment.