830f8a4011
Memind CI / Test, build, and release guards (push) Successful in 5m36s
Ship the 10-item numeric subscription loop on WeChat MP, wire schedule delivery for news/weather/quote/health/finance/tech/knowledge/night/surprise pushes, and extend news morning draft cover generation plus a one-shot draft push script. Co-authored-by: Cursor <cursoragent@cursor.com>
37 lines
1008 B
JavaScript
37 lines
1008 B
JavaScript
import test from 'node:test';
|
|
import assert from 'node:assert/strict';
|
|
|
|
import {
|
|
DAILY_QUOTE_LIBRARY,
|
|
formatDailyQuoteDeliveryText,
|
|
pickDailyQuote,
|
|
} from './daily-quote-library.mjs';
|
|
|
|
test('pickDailyQuote is stable per user/day and varies across days', () => {
|
|
const args = {
|
|
userId: 'user-q',
|
|
timezone: 'Asia/Shanghai',
|
|
now: Date.parse('2026-09-20T07:30:00+08:00'),
|
|
};
|
|
const first = pickDailyQuote(args);
|
|
const second = pickDailyQuote(args);
|
|
assert.equal(first, second);
|
|
assert.ok(DAILY_QUOTE_LIBRARY.includes(first));
|
|
|
|
const nextDay = pickDailyQuote({
|
|
...args,
|
|
now: Date.parse('2026-09-21T07:30:00+08:00'),
|
|
});
|
|
assert.notEqual(first, nextDay);
|
|
});
|
|
|
|
test('formatDailyQuoteDeliveryText wraps quote with header', () => {
|
|
const text = formatDailyQuoteDeliveryText({
|
|
userId: 'user-q2',
|
|
timezone: 'Asia/Shanghai',
|
|
now: Date.parse('2026-09-20T07:30:00+08:00'),
|
|
});
|
|
assert.match(text, /^💡 每日金句\n\n/u);
|
|
assert.match(text, /取消7/u);
|
|
});
|