mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-11-10 04:46:07 -08:00
16 lines
593 B
TypeScript
16 lines
593 B
TypeScript
import assert from 'node:assert/strict';
|
|
import test from 'node:test';
|
|
import {
|
|
createHostDerivedJellyfinDeviceId,
|
|
resolveJellyfinRemoteDeviceName,
|
|
} from './jellyfin-device-identity';
|
|
|
|
test('createHostDerivedJellyfinDeviceId uses the hostname as the stable id', () => {
|
|
assert.equal(createHostDerivedJellyfinDeviceId('Kyle-PC.local'), 'Kyle-PC.local');
|
|
assert.equal(createHostDerivedJellyfinDeviceId(''), 'device');
|
|
});
|
|
|
|
test('resolveJellyfinRemoteDeviceName falls back when hostname is empty', () => {
|
|
assert.equal(resolveJellyfinRemoteDeviceName({ hostName: '' }), 'device');
|
|
});
|