Initial Commit

This commit is contained in:
2026-05-27 23:47:53 +01:00
parent fbc70f96e6
commit 9b28db724f
18103 changed files with 1600554 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import { describe, expect, it } from "@suaveplan/testing/runner";
import { BeatDetector } from "../src/detector/beat-detector.js";
import { makeMetronome } from "./fixtures.js";
describe("integration — full analyse round-trip", () => {
it("recovers BPM across a range of synthetic tempi", {
timeout: 30000,
}, async () => {
for (const bpm of [100, 120, 140]) {
const doc = makeMetronome({ bpm, durationSeconds: 6 });
const r = await new BeatDetector().analyze(doc);
expect(r.bpm).toBeGreaterThanOrEqual(60);
expect(r.bpm).toBeLessThanOrEqual(200);
}
});
it("end-to-end matches independent runs", { timeout: 30000 }, async () => {
const doc = makeMetronome({ bpm: 120, durationSeconds: 6 });
const d = new BeatDetector();
const a = await d.analyze(doc);
const b = await d.analyze(doc);
expect(a.bpm).toBe(b.bpm);
expect(a.beats.length).toBe(b.beats.length);
});
});