mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
chore(repo): remove dead code and useless tests (#3375)
This commit is contained in:
1 parent
7e177a1c90
commit
1cd62eb661
1391 files changed
+783
-120415
No files matched your search
@@ -1,10 +1,6 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
import {
|
||||
createVoiceEngineV2SeededRandomPort,
|
||||
createVoiceEngineV2SystemClockPort,
|
||||
createVoiceEngineV2SystemRandomPort,
|
||||
} from '@fluxer/voice_engine_v2/src/runtime/platformPort';
|
||||
import {createVoiceEngineV2SystemClockPort} from '@fluxer/voice_engine_v2/src/runtime/platformPort';
|
||||
import {afterEach, describe, expect, it, vi} from 'vitest';
|
||||
|
||||
afterEach(() => {
|
||||
@@ -44,21 +40,6 @@ describe('voice engine v2 platform port source failures', () => {
|
||||
expect(clock.sourceFailureCount).toBe(1);
|
||||
});
|
||||
|
||||
it('keeps the random port non-throwing, counts failures, and logs exactly once', () => {
|
||||
const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {});
|
||||
const random = createVoiceEngineV2SystemRandomPort({
|
||||
read(): number {
|
||||
throw new Error('entropy source boom');
|
||||
},
|
||||
});
|
||||
|
||||
expect(random.next()).toBe(0);
|
||||
expect(random.next()).toBe(0);
|
||||
|
||||
expect(random.sourceFailureCount).toBe(2);
|
||||
expect(consoleError).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
it('reports zero failures and stays silent for healthy sources', () => {
|
||||
const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {});
|
||||
const clock = createVoiceEngineV2SystemClockPort({
|
||||
@@ -66,16 +47,9 @@ describe('voice engine v2 platform port source failures', () => {
|
||||
return 42;
|
||||
},
|
||||
});
|
||||
const random = createVoiceEngineV2SystemRandomPort({
|
||||
read(): number {
|
||||
return 0.5;
|
||||
},
|
||||
});
|
||||
|
||||
expect(clock.now()).toBe(42);
|
||||
expect(random.next()).toBe(0.5);
|
||||
expect(clock.sourceFailureCount).toBe(0);
|
||||
expect(random.sourceFailureCount).toBe(0);
|
||||
expect(consoleError).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -100,16 +74,3 @@ describe('voice engine v2 platform port source failures', () => {
|
||||
expect(consoleError).toHaveBeenCalledTimes(2);
|
||||
});
|
||||
});
|
||||
|
||||
describe('voice engine v2 seeded random port', () => {
|
||||
it('produces a deterministic sequence in [0, 1) for a fixed seed', () => {
|
||||
const first = createVoiceEngineV2SeededRandomPort(1234);
|
||||
const second = createVoiceEngineV2SeededRandomPort(1234);
|
||||
for (let i = 0; i < 16; i += 1) {
|
||||
const value = first.next();
|
||||
expect(value).toBe(second.next());
|
||||
expect(value).toBeGreaterThanOrEqual(0);
|
||||
expect(value).toBeLessThan(1);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user