mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-04 07:21:32 -07:00
placeholder
{"subject": "test(subtitles): fix tests for provisional emit and payload signature", "body": "- Expect the provisional plain-text emit alongside the refresh's empty emit\n- Match emitSubtitlePayload regex against its updated parameter signature"}
This commit is contained in:
@@ -585,9 +585,11 @@ test('refreshCurrentSubtitle reports the empty-text emit that an in-flight run w
|
||||
resolveFirst?.({ text: '字幕', tokens: [] });
|
||||
await flushMicrotasks();
|
||||
await flushMicrotasks();
|
||||
// '字幕' is the provisional plain emit the in-flight run already made before
|
||||
// the refresh; '' is the emit the refresh promised.
|
||||
assert.deepEqual(
|
||||
emitted.map((payload) => payload.text),
|
||||
[''],
|
||||
['字幕', ''],
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -620,7 +620,7 @@ test('subtitle broadcasts share one frequency options snapshot per emitted paylo
|
||||
test('annotation upgrades skip the duplicate basic websocket event', () => {
|
||||
const source = readMainSource();
|
||||
const emitBlock = source.match(
|
||||
/function emitSubtitlePayload\(payload: SubtitleData\): void \{(?<body>[\s\S]*?)\n\}/,
|
||||
/function emitSubtitlePayload\([\s\S]*?\): void \{(?<body>[\s\S]*?)\n\}/,
|
||||
)?.groups?.body;
|
||||
|
||||
assert.ok(emitBlock);
|
||||
|
||||
Reference in New Issue
Block a user