report-secret-accumulation.test.js 700 B

123456789101112131415161718192021
  1. import { test, before, after } from 'node:test'
  2. import assert from 'node:assert/strict'
  3. import { run } from '../../src/commands/report-secret-accumulation.js'
  4. import { fixtureCtx } from './_helper.js'
  5. let ctx, cleanup
  6. before(async () => {
  7. ;({ ctx, cleanup } = await fixtureCtx())
  8. })
  9. after(async () => {
  10. await cleanup()
  11. })
  12. test('report-secret-accumulation 返回未揭晓信息差 + 蓄积章数', async () => {
  13. const r = await run([], {}, ctx)
  14. assert.equal(r.ok, true)
  15. const rows = JSON.parse(r.output)
  16. const one = rows.find((s) => s.id === '信息差-001')
  17. assert.ok(one, `应含 信息差-001,实际:${r.output}`)
  18. assert.equal(one.蓄积章数, 1) // max 2 − 登记章 1
  19. })