binary-size.ts 552 B

12345678910111213141516171819202122
  1. import * as fs from "fs/promises";
  2. import path from "path";
  3. import { BenchData, BinarySize } from "../scripts/utils";
  4. const IDL = require("../target/idl/bench.json");
  5. describe("Binary size", () => {
  6. const binarySize: BinarySize = {};
  7. it("Measure binary size", async () => {
  8. const stat = await fs.stat(
  9. path.join("target", "deploy", `${IDL.metadata.name}.so`)
  10. );
  11. binarySize[IDL.metadata.name] = stat.size;
  12. });
  13. after(async () => {
  14. const bench = await BenchData.open();
  15. await bench.update({ binarySize });
  16. });
  17. });