mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-10-20 17:01:24 -07:00
test: cut low-value tests, rewrite the rest around behavior, parallelize lanes (#285)
This commit is contained in:
1 parent
4b6842d034
commit
b48083ddd8
368 files changed
+18045
-60331
No files matched your search
@@ -1,12 +1,6 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {
|
||||
playNextSubtitleRuntime,
|
||||
replayCurrentSubtitleRuntime,
|
||||
sendMpvCommandRuntime,
|
||||
setMpvSubVisibilityRuntime,
|
||||
showMpvOsdRuntime,
|
||||
} from './mpv';
|
||||
import { showMpvOsdRuntime } from './mpv';
|
||||
|
||||
test('showMpvOsdRuntime sends show-text when connected', () => {
|
||||
const commands: (string | number)[][] = [];
|
||||
@@ -55,29 +49,3 @@ test('showMpvOsdRuntime logs fallback when disconnected', () => {
|
||||
assert.equal(shown, false);
|
||||
assert.deepEqual(logs, ['OSD (MPV not connected): hello']);
|
||||
});
|
||||
|
||||
test('mpv runtime command wrappers call expected client methods', () => {
|
||||
const calls: string[] = [];
|
||||
const client = {
|
||||
connected: true,
|
||||
send: ({ command }: { command: (string | number)[] }) => {
|
||||
calls.push(`send:${command.join(',')}`);
|
||||
},
|
||||
replayCurrentSubtitle: () => {
|
||||
calls.push('replay');
|
||||
},
|
||||
playNextSubtitle: () => {
|
||||
calls.push('next');
|
||||
},
|
||||
setSubVisibility: (visible: boolean) => {
|
||||
calls.push(`subVisible:${visible}`);
|
||||
},
|
||||
};
|
||||
|
||||
replayCurrentSubtitleRuntime(client);
|
||||
playNextSubtitleRuntime(client);
|
||||
sendMpvCommandRuntime(client, ['script-message', 'x']);
|
||||
setMpvSubVisibilityRuntime(client, false);
|
||||
|
||||
assert.deepEqual(calls, ['replay', 'next', 'send:script-message,x', 'subVisible:false']);
|
||||
});
|
||||
Reference in new issue
Block a user