374 lines · 18.8 KB
import { beforeEach, describe, expect, test } from "bun:test";
import { meterDef } from "~/lib/meters";
const {
  state,
  accountSql,
  repoSql,
  seedSite,
  points,
  fakeEnv,
  captured,
  quantity,
  resetMeteringHarness,
  recordUsage,
  recordUsageSoon,
  setGauge,
  claimScratchUsage,
  periodOf,
  MeteringError,
  reserveUsage,
  commitUsage,
  releaseUsage,
  assertWithinQuota,
  QuotaExceededError,
  setPlan,
  setSpendingLimit,
  hardCap,
  billingSettings,
  ciRunAccount,
  tokenAccount,
  repoOwnerAccount,
  scratchSiteAccount,
  scratchIpAccount,
  usageSummary,
  alertCandidates,
  publishScopeGauges,
  runAccountTask,
  jobSeconds,
  runnerMeter,
  aiMeter,
  onScratchClaimed,