chore: 현재 작업 중간 커밋

This commit is contained in:
chungyeong
2026-03-05 11:00:45 +09:00
parent 02970df6af
commit be88b4fcec
43 changed files with 6837 additions and 466 deletions

View File

@@ -28,7 +28,7 @@ test("global crawling toggle skips polling", async () => {
const watchId = watcher.addWatch({
rawInput: "테스트",
searchParams: { segments: [{ from: "ICN", to: "MAD" }] },
searchParams: { segments: [{ from: "ICN", to: "MAD" }], departureDateWindow: { from: "2026-06-01" } },
alertRules: { targetPrice: 900, notifyOnPriceChange: true },
});
@@ -57,7 +57,7 @@ test("watch-level polling toggle skips polling", async () => {
const watchId = watcher.addWatch({
rawInput: "테스트",
searchParams: { segments: [{ from: "ICN", to: "MAD" }] },
searchParams: { segments: [{ from: "ICN", to: "MAD" }], departureDateWindow: { from: "2026-06-01" } },
alertRules: { targetPrice: null, notifyOnPriceChange: true },
pollingEnabled: false,
});
@@ -91,7 +91,7 @@ test("alerts can be suppressed while still computing alert events", async () =>
const watchId = watcher.addWatch({
rawInput: "테스트",
searchParams: { segments: [{ from: "ICN", to: "MAD" }] },
searchParams: { segments: [{ from: "ICN", to: "MAD" }], departureDateWindow: { from: "2026-06-01" } },
alertRules: { targetPrice: 950, notifyOnPriceChange: true },
alertsEnabled: false,
});
@@ -103,3 +103,22 @@ test("alerts can be suppressed while still computing alert events", async () =>
assert.equal(second.alert.eventType, "target_price");
assert.equal(second.alert.notificationSuppressed, true);
});
test("poll interval under 1 hour throws immediately", () => {
assert.throws(
() =>
new PriceWatcher({
crawler: {
async getQuotes() {
return [{ provider: "x", price: 1000, currency: "KRW" }];
},
},
notifier: {
async notify() {},
},
pollIntervalMs: 1000,
logger: createSilentLogger(),
}),
/3600000 이상이어야 합니다/
);
});