mirror of
https://github.com/Psychotoxical/psysonic.git
synced 2026-07-22 07:15:47 +00:00
7a7a9f5e6b
111 of 122 top-level src/utils/ files move into 16 topic folders (audio, cache, cover, share, server, playback, playlist, deviceSync, waveform, mix, format, export, changelog, ui, perf, componentHelpers). True singletons with no cluster stay at the utils/ root. Pure file-move: a path-aware codemod rewrote 539 relative-import specifiers across 275 files; no logic touched. The hot-path coverage gate list (.github/frontend-hot-path-files.txt) is updated to the new paths for the 11 gated utils files — a mechanical consequence of the move, not a CI change. tsc is green.
29 lines
1003 B
TypeScript
29 lines
1003 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { isRecoverableSeekError } from './seekErrors';
|
|
|
|
describe('isRecoverableSeekError', () => {
|
|
it.each([
|
|
'not seekable',
|
|
'audio sink not ready',
|
|
'audio seek busy',
|
|
'audio seek timeout',
|
|
])('classifies "%s" as recoverable', msg => {
|
|
expect(isRecoverableSeekError(msg)).toBe(true);
|
|
});
|
|
|
|
it('matches when the marker is embedded in a longer message', () => {
|
|
expect(isRecoverableSeekError('seek failed: audio sink not ready yet')).toBe(true);
|
|
expect(isRecoverableSeekError('error: audio seek timeout after 6000ms')).toBe(true);
|
|
});
|
|
|
|
it('returns false for unrelated errors', () => {
|
|
expect(isRecoverableSeekError('decoder failed')).toBe(false);
|
|
expect(isRecoverableSeekError('file not found')).toBe(false);
|
|
expect(isRecoverableSeekError('')).toBe(false);
|
|
});
|
|
|
|
it('is case-sensitive (Rust messages are stable)', () => {
|
|
expect(isRecoverableSeekError('Audio Sink Not Ready')).toBe(false);
|
|
});
|
|
});
|