mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-07 01:15:47 +01:00
test(autoplan-budget): bind the reservation expectation to lib/autoplan-budget's default estimate (test-of-test ratchet)
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
1 parent
205d9c8c88
commit
b40d8418f9
1 file changed
+2
-1
@@ -12,6 +12,7 @@
|
||||
import { afterAll, describe, expect, test } from 'bun:test';
|
||||
import * as fs from 'node:fs';
|
||||
import * as path from 'node:path';
|
||||
import { DEFAULT_HOST_ESTIMATE_USD } from '../lib/autoplan-budget';
|
||||
import { SMALL_PLAN } from './helpers/autoplan-run-fixture';
|
||||
import { capyRunner, phaseVia, readJsonl, readRunJson, writePlan } from './helpers/autoplan-capy';
|
||||
|
||||
@@ -102,7 +103,7 @@ describe('close --deferred', () => {
|
||||
expect(run.phases.ceo.outside.status).toBe('skipped');
|
||||
expect(run.phases.ceo.outside.attempts[0].state).toBe('deferred');
|
||||
const settled = spend(s.out).settled.find((x: any) => x.attempt === outsideAttempt);
|
||||
expect(settled).toMatchObject({ usd: 'unknown', reserved_usd: 5 });
|
||||
expect(settled).toMatchObject({ usd: 'unknown', reserved_usd: DEFAULT_HOST_ESTIMATE_USD });
|
||||
expect(spend(s.out).released).toEqual([]);
|
||||
const after = unknownUsd(s.out) + spend(s.out).reserved.reduce((t: number, x: any) => t + x.estimate_usd, 0);
|
||||
expect(after).toBe(before);
|
||||
|
||||
Reference in new issue
Block a user