import { test } from '@japa/runner' import coordinatorConfig from '#config/coordinator' test.group('CatalogSpace', () => { test('is full over its cap, and off without one', async ({ assert }) => { const before = coordinatorConfig.catalogMaxNvmeGb try { const { default: off } = await import('#services/catalog_space') coordinatorConfig.catalogMaxNvmeGb = 0 assert.isFalse(await off.full()) // A fresh measurement with a cap far under any database's size. ;(off as any).checkedAt = 0 coordinatorConfig.catalogMaxNvmeGb = 0.000001 assert.isTrue(await off.full()) ;(off as any).checkedAt = 0 coordinatorConfig.catalogMaxNvmeGb = 1_000_000 assert.isFalse(await off.full()) } finally { coordinatorConfig.catalogMaxNvmeGb = before } }) })