Move remaining alertSearch tests under test/.
Keep them beside the existing SMS alertSearch tests and update imports so they still load src/.
This commit is contained in:
@@ -3,17 +3,17 @@ import { mkdtemp, rm } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterEach, beforeEach, describe, it } from "node:test";
|
||||
import { alertSearchCursorsDb } from "../db/alertSearchCursorsSqlite.js";
|
||||
import { closeDatabase } from "../db/sqlite.js";
|
||||
import { alertSearchCursorsDb } from "../../src/db/alertSearchCursorsSqlite.js";
|
||||
import { closeDatabase } from "../../src/db/sqlite.js";
|
||||
import {
|
||||
advanceAlertSearchCursors,
|
||||
loadAlertSearchCursors,
|
||||
maxEndorserAlertSearchUlid,
|
||||
} from "./cursors.js";
|
||||
import { retrieveAlertSearch } from "./retrieve.js";
|
||||
import type { AlertSearchSourceResult, RetrieveAlertSearchResult } from "./retrieve.js";
|
||||
import { ALERT_SEARCH_PAGE_SIZE } from "./types.js";
|
||||
import type { EndorserAlertSearchData, PartnerAlertSearchData } from "./types.js";
|
||||
} from "../../src/alertSearch/cursors.js";
|
||||
import { retrieveAlertSearch } from "../../src/alertSearch/retrieve.js";
|
||||
import type { AlertSearchSourceResult, RetrieveAlertSearchResult } from "../../src/alertSearch/retrieve.js";
|
||||
import { ALERT_SEARCH_PAGE_SIZE } from "../../src/alertSearch/types.js";
|
||||
import type { EndorserAlertSearchData, PartnerAlertSearchData } from "../../src/alertSearch/types.js";
|
||||
|
||||
const USER = "did:ethr:0xcursoruser";
|
||||
const OTHER_USER = "did:ethr:0xother";
|
||||
@@ -3,14 +3,14 @@ import { mkdtemp, rm } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterEach, beforeEach, describe, it } from "node:test";
|
||||
import { alertSearchCursorsDb } from "../db/alertSearchCursorsSqlite.js";
|
||||
import { closeDatabase } from "../db/sqlite.js";
|
||||
import { alertSearchCursorsDb } from "../../src/db/alertSearchCursorsSqlite.js";
|
||||
import { closeDatabase } from "../../src/db/sqlite.js";
|
||||
import {
|
||||
partnerPageHasTiedBeforeDate,
|
||||
type FetchLike,
|
||||
} from "./client.js";
|
||||
import { runAlertSearchCycle } from "./cycle.js";
|
||||
import { ALERT_SEARCH_PAGE_SIZE } from "./types.js";
|
||||
} from "../../src/alertSearch/client.js";
|
||||
import { runAlertSearchCycle } from "../../src/alertSearch/cycle.js";
|
||||
import { ALERT_SEARCH_PAGE_SIZE } from "../../src/alertSearch/types.js";
|
||||
|
||||
const USER = "did:ethr:0xcycleuser";
|
||||
const JWT = "delegated.jwt.token";
|
||||
@@ -8,12 +8,12 @@ import {
|
||||
ALERT_JWT_STATUS_UNUSED,
|
||||
alertAuthorizationDb,
|
||||
type AlertAuthorizationJwtInput,
|
||||
} from "../db/alertAuthorizationSqlite.js";
|
||||
import { alertSearchCursorsDb } from "../db/alertSearchCursorsSqlite.js";
|
||||
import { closeDatabase } from "../db/sqlite.js";
|
||||
import type { FetchLike } from "./client.js";
|
||||
import { runDailyAlertSearch } from "./daily.js";
|
||||
import { ALERT_SEARCH_PAGE_SIZE } from "./types.js";
|
||||
} from "../../src/db/alertAuthorizationSqlite.js";
|
||||
import { alertSearchCursorsDb } from "../../src/db/alertSearchCursorsSqlite.js";
|
||||
import { closeDatabase } from "../../src/db/sqlite.js";
|
||||
import type { FetchLike } from "../../src/alertSearch/client.js";
|
||||
import { runDailyAlertSearch } from "../../src/alertSearch/daily.js";
|
||||
import { ALERT_SEARCH_PAGE_SIZE } from "../../src/alertSearch/types.js";
|
||||
|
||||
const USER = "did:ethr:0xdailyuser";
|
||||
const ENDORSER_BASE = "https://api.endorser.ch";
|
||||
@@ -4,9 +4,9 @@ import {
|
||||
ALERT_SEARCH_DIGEST_BUCKETS,
|
||||
alertSearchDigestDebugSummary,
|
||||
buildAlertSearchDigest,
|
||||
} from "./digest.js";
|
||||
import { emptyEndorserData, emptyPartnerData } from "./client.js";
|
||||
import type { AlertSearchSourceResult, RetrieveAlertSearchResult } from "./retrieve.js";
|
||||
} from "../../src/alertSearch/digest.js";
|
||||
import { emptyEndorserData, emptyPartnerData } from "../../src/alertSearch/client.js";
|
||||
import type { AlertSearchSourceResult, RetrieveAlertSearchResult } from "../../src/alertSearch/retrieve.js";
|
||||
import type {
|
||||
AlertSearchClaimRecord,
|
||||
AlertSearchFailureReason,
|
||||
@@ -17,7 +17,7 @@ import type {
|
||||
CombinedAlertSearchData,
|
||||
EndorserAlertSearchData,
|
||||
PartnerAlertSearchData,
|
||||
} from "./types.js";
|
||||
} from "../../src/alertSearch/types.js";
|
||||
|
||||
function ulid(n: number): string {
|
||||
return `01H${String(n).padStart(23, "0")}`;
|
||||
@@ -3,10 +3,10 @@ import { mkdtemp, rm } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterEach, beforeEach, describe, it } from "node:test";
|
||||
import { db as fcmDb } from "../db/fcmTokensSqlite.js";
|
||||
import { closeDatabase } from "../db/sqlite.js";
|
||||
import type { DailyAlertSearchResult } from "./daily.js";
|
||||
import type { AlertSearchDigest } from "./digest.js";
|
||||
import { db as fcmDb } from "../../src/db/fcmTokensSqlite.js";
|
||||
import { closeDatabase } from "../../src/db/sqlite.js";
|
||||
import type { DailyAlertSearchResult } from "../../src/alertSearch/daily.js";
|
||||
import type { AlertSearchDigest } from "../../src/alertSearch/digest.js";
|
||||
import {
|
||||
ALERT_SEARCH_FCM_TYPE,
|
||||
ALERT_SEARCH_NOTIFICATION_TITLE,
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
buildAlertSearchNotificationContent,
|
||||
deliverAlertSearchNotification,
|
||||
isAlertSearchNotificationEligible,
|
||||
} from "./notify.js";
|
||||
} from "../../src/alertSearch/notify.js";
|
||||
|
||||
const USER = "did:ethr:0xnotifyuser";
|
||||
|
||||
@@ -4,11 +4,11 @@ import {
|
||||
alertSearchUrl,
|
||||
buildAlertSearchQuery,
|
||||
isAlertSearchCursorUlid,
|
||||
} from "./params.js";
|
||||
} from "../../src/alertSearch/params.js";
|
||||
import {
|
||||
ENDORSER_ALERT_SEARCH_PATH,
|
||||
PARTNER_ALERT_SEARCH_PATH,
|
||||
} from "./types.js";
|
||||
} from "../../src/alertSearch/types.js";
|
||||
|
||||
const LOCATION = {
|
||||
minLocLat: 40.7,
|
||||
@@ -5,9 +5,9 @@ import {
|
||||
fetchPartnerAlertSearchPage,
|
||||
nextEndorserBeforeId,
|
||||
type FetchLike,
|
||||
} from "./client.js";
|
||||
import { retrieveAlertSearch } from "./retrieve.js";
|
||||
import { ALERT_SEARCH_PAGE_SIZE, type EndorserAlertSearchData } from "./types.js";
|
||||
} from "../../src/alertSearch/client.js";
|
||||
import { retrieveAlertSearch } from "../../src/alertSearch/retrieve.js";
|
||||
import { ALERT_SEARCH_PAGE_SIZE, type EndorserAlertSearchData } from "../../src/alertSearch/types.js";
|
||||
|
||||
const JWT = "delegated.jwt.token";
|
||||
const ENDORSER_BASE = "https://api.endorser.ch";
|
||||
@@ -4,18 +4,18 @@ import { mkdtemp, rm } from "node:fs/promises";
|
||||
import { tmpdir } from "node:os";
|
||||
import path from "node:path";
|
||||
import { afterEach, beforeEach, describe, it } from "node:test";
|
||||
import { alertAuthorizationDb } from "../db/alertAuthorizationSqlite.js";
|
||||
import { db as fcmDb } from "../db/fcmTokensSqlite.js";
|
||||
import { closeDatabase } from "../db/sqlite.js";
|
||||
import type { DailyAlertSearchResult } from "./daily.js";
|
||||
import { alertAuthorizationDb } from "../../src/db/alertAuthorizationSqlite.js";
|
||||
import { db as fcmDb } from "../../src/db/fcmTokensSqlite.js";
|
||||
import { closeDatabase } from "../../src/db/sqlite.js";
|
||||
import type { DailyAlertSearchResult } from "../../src/alertSearch/daily.js";
|
||||
import {
|
||||
isAlertSearchSchedulerPassInFlight,
|
||||
resetAlertSearchSchedulerPassGuard,
|
||||
runAlertSearchSchedulerPass,
|
||||
startAlertSearchScheduler,
|
||||
stopAlertSearchScheduler,
|
||||
} from "./scheduler.js";
|
||||
import type { AlertSearchDigest } from "./digest.js";
|
||||
} from "../../src/alertSearch/scheduler.js";
|
||||
import type { AlertSearchDigest } from "../../src/alertSearch/digest.js";
|
||||
|
||||
const USER_A = "did:ethr:0xusera";
|
||||
const USER_B = "did:ethr:0xuserb";
|
||||
Reference in New Issue
Block a user