mirror of
https://github.com/lWolvesl/antigravity-usage-monitor.git
synced 2026-11-27 01:19:25 +08:00
refactor(panel): complete shared single-source rules, isolate per-module bundle scopes, and purify scoped selector
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import vm from 'node:vm';
|
||||
import { normalizeClientWindowMountMode } from '../src/store/telemetryStore.js';
|
||||
import { isEquivalentTelemetry } from '../src/store/telemetryStore.js';
|
||||
import { backendHarness } from './backend-harness.mjs';
|
||||
|
||||
const FLASH = 'MODEL_PLACEHOLDER_M318';
|
||||
@@ -286,14 +284,9 @@ test('exhausted 0% bucket omitting remainingFraction in proto3 is reported as 10
|
||||
});
|
||||
|
||||
test('telemetryStore isEquivalentTelemetry detects quota changes in non-active pools', () => {
|
||||
const source = fs.readFileSync(new URL('../src/store/telemetryStore.js', import.meta.url), 'utf8');
|
||||
const fn = source.slice(
|
||||
source.indexOf('function isEquivalentTelemetry'),
|
||||
source.indexOf('export async function fetchTelemetry')
|
||||
);
|
||||
const ctx = { normalizeClientWindowMountMode };
|
||||
vm.runInNewContext(fn + '\nglobalThis.compare=isEquivalentTelemetry;', ctx);
|
||||
const compare = isEquivalentTelemetry;
|
||||
|
||||
const ctx = { compare };
|
||||
const a = {
|
||||
account: { tierName: 'Google AI Pro', planName: 'Pro' },
|
||||
quotas: {
|
||||
|
||||
Reference in New Issue
Block a user