2baf29b3ae
Deliver encrypted health zone, observation API, baseline maturity pipeline, page-data bindings, and H5/WeChat channel integration for health P0. Co-authored-by: Cursor <cursoragent@cursor.com>
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import {
|
|
healthBaselineJobIntervalMs,
|
|
healthBaselineJobUserBatchLimit,
|
|
isHealthBaselineJobEnabled,
|
|
} from './health-baseline-worker-config.mjs';
|
|
|
|
test('baseline job requires health feature flag', () => {
|
|
assert.equal(
|
|
isHealthBaselineJobEnabled({ MEMIND_HEALTH_ENABLED: '0', MEMIND_HEALTH_BASELINE_JOB_ENABLED: '1' }),
|
|
false,
|
|
);
|
|
assert.equal(
|
|
isHealthBaselineJobEnabled({ MEMIND_HEALTH_ENABLED: '1', MEMIND_HEALTH_BASELINE_JOB_ENABLED: '1' }),
|
|
true,
|
|
);
|
|
});
|
|
|
|
test('baseline job follows reminder worker when unset', () => {
|
|
assert.equal(
|
|
isHealthBaselineJobEnabled({ MEMIND_HEALTH_ENABLED: '1', H5_REMINDER_WORKER_ENABLED: '1' }),
|
|
true,
|
|
);
|
|
assert.equal(
|
|
isHealthBaselineJobEnabled({ MEMIND_HEALTH_ENABLED: '1', H5_REMINDER_WORKER_ENABLED: '0' }),
|
|
false,
|
|
);
|
|
});
|
|
|
|
test('baseline job interval and user limit have safe defaults', () => {
|
|
assert.equal(healthBaselineJobIntervalMs({}), 60 * 60 * 1000);
|
|
assert.equal(healthBaselineJobUserBatchLimit({}), 500);
|
|
});
|