mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-08-04 19:21:33 -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: [] });
|
resolveFirst?.({ text: '字幕', tokens: [] });
|
||||||
await flushMicrotasks();
|
await flushMicrotasks();
|
||||||
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(
|
assert.deepEqual(
|
||||||
emitted.map((payload) => payload.text),
|
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', () => {
|
test('annotation upgrades skip the duplicate basic websocket event', () => {
|
||||||
const source = readMainSource();
|
const source = readMainSource();
|
||||||
const emitBlock = source.match(
|
const emitBlock = source.match(
|
||||||
/function emitSubtitlePayload\(payload: SubtitleData\): void \{(?<body>[\s\S]*?)\n\}/,
|
/function emitSubtitlePayload\([\s\S]*?\): void \{(?<body>[\s\S]*?)\n\}/,
|
||||||
)?.groups?.body;
|
)?.groups?.body;
|
||||||
|
|
||||||
assert.ok(emitBlock);
|
assert.ok(emitBlock);
|
||||||
|
|||||||
Reference in New Issue
Block a user