Skip to content

src/commit-complete.node.test.ts

20 lines · 693 B · TypeScript
Raw
import assert from 'node:assert/strict'
import test from 'node:test'
import { commitLooksStored } from './commit-complete.ts'

test('keeps a successful empty-file persist (merge commits) stored', () => {
	assert.equal(commitLooksStored(0, 0, 0), true)
})

test('keeps skipped-only commits without requiring buckets', () => {
	assert.equal(commitLooksStored(0, 3, 0), true)
})

test('requires at least one bucket when countable files were recorded', () => {
	assert.equal(commitLooksStored(2, 0, 0), false)
	assert.equal(commitLooksStored(2, 1, 1), true)
})

test('treats a zero-delta countable ingest as stored once a bucket exists', () => {
	assert.equal(commitLooksStored(1, 0, 1), true)
})