ci: trigga på master + formatfix inför Gitea Actions
CI / Typecheck, test & build (push) Failing after 2s

This commit is contained in:
Sven (AAMOS AI)
2026-08-13 17:25:14 +07:00
parent 61d60931ad
commit c32a7e33c7
141 changed files with 40555 additions and 45210 deletions
@@ -5,11 +5,31 @@ import type { AnalyticsEvent, RecipeSignal } from "../src/gap-report.js";
describe("buildGapReport", () => {
it("identifierar topp-saknade ingredienser", () => {
const events: AnalyticsEvent[] = [
{ eventName: "recipe_search_zero_results", occurredAt: new Date(), properties: { query: "lax", suggestedIngredientId: "laxfile" } },
{ eventName: "recipe_search_zero_results", occurredAt: new Date(), properties: { query: "lax", suggestedIngredientId: "laxfile" } },
{ eventName: "recipe_search_zero_results", occurredAt: new Date(), properties: { query: "lax", suggestedIngredientId: "laxfile" } },
{ eventName: "recipe_search_zero_results", occurredAt: new Date(), properties: { query: "tofu", suggestedIngredientId: "fast_tofu" } },
{ eventName: "recipe_search_zero_results", occurredAt: new Date(), properties: { query: "tofu", suggestedIngredientId: "fast_tofu" } },
{
eventName: "recipe_search_zero_results",
occurredAt: new Date(),
properties: { query: "lax", suggestedIngredientId: "laxfile" },
},
{
eventName: "recipe_search_zero_results",
occurredAt: new Date(),
properties: { query: "lax", suggestedIngredientId: "laxfile" },
},
{
eventName: "recipe_search_zero_results",
occurredAt: new Date(),
properties: { query: "lax", suggestedIngredientId: "laxfile" },
},
{
eventName: "recipe_search_zero_results",
occurredAt: new Date(),
properties: { query: "tofu", suggestedIngredientId: "fast_tofu" },
},
{
eventName: "recipe_search_zero_results",
occurredAt: new Date(),
properties: { query: "tofu", suggestedIngredientId: "fast_tofu" },
},
];
const report = buildGapReport(events, [], []);
@@ -20,7 +40,11 @@ describe("buildGapReport", () => {
it("filtrerar bort enstaka missar", () => {
const events: AnalyticsEvent[] = [
{ eventName: "recipe_search_zero_results", occurredAt: new Date(), properties: { query: "enstaka" } },
{
eventName: "recipe_search_zero_results",
occurredAt: new Date(),
properties: { query: "enstaka" },
},
];
const report = buildGapReport(events, [], [], { minMissThreshold: 2 });
expect(report.entries).toHaveLength(0);
@@ -28,8 +52,16 @@ describe("buildGapReport", () => {
it("formaterar rapporten", () => {
const events: AnalyticsEvent[] = [
{ eventName: "recipe_search_zero_results", occurredAt: new Date(), properties: { query: "lax" } },
{ eventName: "recipe_search_zero_results", occurredAt: new Date(), properties: { query: "lax" } },
{
eventName: "recipe_search_zero_results",
occurredAt: new Date(),
properties: { query: "lax" },
},
{
eventName: "recipe_search_zero_results",
occurredAt: new Date(),
properties: { query: "lax" },
},
];
const report = buildGapReport(events, [], [], { minMissThreshold: 1 });
const text = formatGapReport(report);