1
0

SummaryWriter.test.js 691 B

1234567891011121314151617
  1. import { test } from 'node:test'
  2. import assert from 'node:assert/strict'
  3. import { SummaryWriter } from '../../../src/storage/adapters/SummaryWriter.js'
  4. import { makeRepo, cleanup, read } from '../_tmprepo.js'
  5. test('SummaryWriter.writeChapterSummary 写章摘要到 定稿/摘要/章摘要/NNNN.md', async () => {
  6. const root = await makeRepo()
  7. try {
  8. const w = new SummaryWriter(root)
  9. const r = await w.writeChapterSummary(152, '林晚于北境得血书,玄阶令牌现世。')
  10. assert.equal(r.ok, true)
  11. const content = await read(root, '定稿/摘要/章摘要/0152.md')
  12. assert.match(content, /林晚于北境得血书/)
  13. } finally {
  14. await cleanup(root)
  15. }
  16. })