删除无用字段

This commit is contained in:
yml
2026-04-14 18:07:09 +08:00
parent 9f6f67c8a8
commit 813c733860
10 changed files with 102 additions and 14 deletions
@@ -0,0 +1,25 @@
import test from 'node:test'
import assert from 'node:assert/strict'
import {
REDEEM_SUCCESS_AUTO_CLOSE_MS,
resolveTencentSessionExpiresAt,
} from './session.js'
test('resolveTencentSessionExpiresAt uses normal ttl when no auto-close is armed', () => {
const nowMs = Date.UTC(2026, 3, 14, 9, 30, 0)
assert.equal(
resolveTencentSessionExpiresAt({ autoCloseAt: 0 }, nowMs),
nowMs + (30 * 60 * 1000),
)
})
test('resolveTencentSessionExpiresAt keeps redeemed auto-close deadline once armed', () => {
const nowMs = Date.UTC(2026, 3, 14, 9, 30, 0)
const autoCloseAt = nowMs + REDEEM_SUCCESS_AUTO_CLOSE_MS
assert.equal(
resolveTencentSessionExpiresAt({ autoCloseAt }, nowMs + 60_000),
autoCloseAt,
)
})