Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

uploadProgress.test.ts

11 lines393 Bytes

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});