ci: trigga på master + formatfix inför Gitea Actions
CI / Typecheck, test & build (push) Failing after 2s
CI / Typecheck, test & build (push) Failing after 2s
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user