| 35 | } |
| 36 | |
| 37 | function writeIncrementalJsonl(filePath: string): void { |
| 38 | const rows = [ |
| 39 | { |
| 40 | _type: 'header', |
| 41 | chatlab: { version: '1.0.0', exportedAt: 1780830000 }, |
| 42 | meta: { name: 'Incremental Chat', platform: 'qq', type: 'group' }, |
| 43 | }, |
| 44 | { _type: 'member', platformId: 'u1', accountName: 'Alice' }, |
| 45 | { |
| 46 | _type: 'message', |
| 47 | sender: 'u1', |
| 48 | accountName: 'Alice', |
| 49 | timestamp: 2000, |
| 50 | type: 0, |
| 51 | content: 'new incremental message', |
| 52 | platformMessageId: 'm1', |
| 53 | }, |
| 54 | ] |
| 55 | fs.writeFileSync(filePath, rows.map((row) => JSON.stringify(row)).join('\n'), 'utf-8') |
| 56 | } |
| 57 | |
| 58 | test('incrementalImport raises the data directory gate after successful writes', async () => { |
| 59 | const root = makeTempDir() |