1
2
3
4
5
6
7
8
9
10
11
12
| import assert from 'node:assert/strict'
| import { readFile } from 'node:fs/promises'
|
| const view = await readFile(new URL('../src/views/TestConsole.vue', import.meta.url), 'utf8')
|
| assert.match(view, /function handleLiveError\(error: Error\)/)
| assert.match(view, /liveError\.value = error\.message/)
| assert.match(view, /sources: \[\], testPlan: null/)
| assert.match(view, /receptionState\.value = pausing \? '暂停接收' : '接收中'[\s\S]{0,180}liveError\.value = ''/)
| assert.match(view, /await endTestReception\(testId\.value\)[\s\S]{0,100}state\.value = '检测完成'/)
|
| console.log('测试控制台暂停/停止生命周期契约通过')
|
|