Continue new scrapes where the last complete one started
This commit is contained in:
@@ -1437,6 +1437,23 @@ void (async () => {
|
||||
reopened.close();
|
||||
});
|
||||
|
||||
await test("dbSummary reports the message span and newest id", () => {
|
||||
const dir = join(root, "summary");
|
||||
mkdirSync(dir, { recursive: true });
|
||||
const store = new ScrapeStore(dir);
|
||||
store.insertPage([
|
||||
message("1800", { timestamp: "2026-09-16T00:00:00.000Z" }),
|
||||
message("1801", { timestamp: "2026-09-17T00:00:00.000Z" })
|
||||
]);
|
||||
|
||||
const summary = store.dbSummary();
|
||||
assert.equal(summary.messages, 2);
|
||||
assert.equal(summary.oldest, "2026-09-16T00:00:00.000Z");
|
||||
assert.equal(summary.newest, "2026-09-17T00:00:00.000Z");
|
||||
assert.equal(summary.newestId, "1801");
|
||||
store.close();
|
||||
});
|
||||
|
||||
await test("message links build for guilds and DMs", () => {
|
||||
assert.equal(messageUrlFor("123", "456", "789"), "https://discord.com/channels/123/456/789");
|
||||
assert.equal(messageUrlFor(null, "456", "789"), "https://discord.com/channels/@me/456/789");
|
||||
|
||||
Reference in New Issue
Block a user