Open History to see the last commit
1import { describe, expect, it } from "vite-plus/test";
2
3import { wholeUploadPercent } from "./uploadProgress.ts";
4
5describe("wholeUploadPercent", () => {
6 it("shows exact whole percentages without rounding partial percentages up", () => {
7 expect(
8 [475136 / 1638400, 57 / 100, 475135 / 1638400, 0.2899999999999999].map(wholeUploadPercent),
9 ).toEqual([29, 57, 28, 28]);
10 });
11});