UNPKG

@clutchd/component

Version:

A primitive component intended to be used as a foundation for all other ui components.

20 lines (17 loc) 757 B
import { expect, test } from "bun:test"; import { readFileSync } from "node:fs"; import { getLocalSize, getRemoteSize } from "@clutchd/bundlejs"; test("ensures the bundle size is smaller than the last size", async () => { const og = await getRemoteSize("@clutchd/component"); const size = await getLocalSize([readFileSync("dist/index.js", "utf8")]); if (og) { expect(size.rawCompressedSize).toBeLessThanOrEqual(og.rawCompressedSize); } }); test("ensures the package is smaller than the original size", async () => { const og = await getRemoteSize("@radix-ui/react-primitive"); const size = await getRemoteSize("@clutchd/component"); if (og && size) { expect(size.rawCompressedSize).toBeLessThanOrEqual(og.rawCompressedSize); } });