Initial import of zappier-edge from zapier monorepo

This commit is contained in:
George Lambert 2026-09-11 13:50:46 -04:00
commit f0d193b221
120 changed files with 19867 additions and 0 deletions

View file

@ -0,0 +1,19 @@
import { computeDelta } from '../src/billing/stripe';
describe('computeDelta', () => {
it('returns the difference when billable exceeds prior', () => {
expect(computeDelta(800, 500)).toBe(300);
});
it('returns 0 when billable equals prior', () => {
expect(computeDelta(500, 500)).toBe(0);
});
it('never returns a negative value when billable is below prior', () => {
expect(computeDelta(300, 500)).toBe(0);
});
it('returns the full billable amount when nothing was reported before', () => {
expect(computeDelta(500, 0)).toBe(500);
});
});