freetravel/test/helpers.ts
Peppa 20028b790b
All checks were successful
peppa/lint lint: success за 1с
peppa/typecheck typecheck: success за 2с
peppa/test test: success за 1с
peppa/build build: success за 1с
ci / checks (pull_request) Successful in 15s
deploy / deploy (pull_request) Successful in 13s
FRTVL-2: регулярный поиск раз в сутки и уведомления в Телеграм
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-14 22:59:33 +05:00

36 lines
1.1 KiB
TypeScript

import type { RawInternship } from "../src/domain/internship.js";
import { type Catalog, emptyCatalog } from "../src/domain/internship.js";
import type { CatalogStore } from "../src/store/catalogStore.js";
export function raw(overrides: Partial<RawInternship> = {}): RawInternship {
return {
title: "Guest Service Intern",
organization: "Hotel Alpina",
country: "Швейцария",
city: "Церматт",
field: "Отель",
funding: "full",
coveredExpenses: "Проживание, питание, перелёт",
participationFee: null,
language: "russian",
languageDetails: "Русский",
customerService: true,
adjacent: false,
confidence: "high",
deadline: null,
sourceUrl: "https://example.org/alpina",
rationale: "Подходит",
...overrides,
};
}
export class MemoryStore implements CatalogStore {
constructor(public catalog: Catalog = emptyCatalog()) {}
async load(): Promise<Catalog> {
return structuredClone(this.catalog);
}
async save(catalog: Catalog): Promise<void> {
this.catalog = structuredClone(catalog);
}
}