Skip to content

Commit

Permalink
🪟 🐛 Fix test with potentially mismatching time values (#21795)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephkmh authored Jan 24, 2023
1 parent 04a77ad commit e4a7736
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,13 @@ describe("#progressBarCalculations", () => {
});
});

const makeAttempt = (
totalStats: AttemptStats = {},
streamStats: AttemptStreamStats[] = [],
const makeAttempt = (totalStats: AttemptStats = {}, streamStats: AttemptStreamStats[] = []) => {
const now = Date.now();
// API returns time in seconds
createdAt = Date.now() / 1000 - 10,
updatedAt = Date.now() / 1000,
id = 123,
status: AttemptStatus = "running"
) => {
const createdAt = now / 1000 - 10;
const updatedAt = now / 1000;
const id = 123;
const status: AttemptStatus = "running";
const attempt: AttemptRead = { id, status, createdAt, updatedAt, totalStats, streamStats };
return attempt;
};

0 comments on commit e4a7736

Please sign in to comment.