mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-26 16:19:26 -07:00
fix: address PR review follow-ups
This commit is contained in:
@@ -4,9 +4,10 @@ import test from 'node:test';
|
||||
import { searchAniListMediaCandidates } from './fetch';
|
||||
|
||||
test('searchAniListMediaCandidates trims fallback candidate titles', async () => {
|
||||
const previousFetch = globalThis.fetch;
|
||||
const previousFetchDescriptor = Object.getOwnPropertyDescriptor(globalThis, 'fetch');
|
||||
Object.defineProperty(globalThis, 'fetch', {
|
||||
configurable: true,
|
||||
writable: true,
|
||||
value: async () =>
|
||||
new Response(
|
||||
JSON.stringify({
|
||||
@@ -24,6 +25,10 @@ test('searchAniListMediaCandidates trims fallback candidate titles', async () =>
|
||||
|
||||
assert.equal(candidates[0]?.title, 'Re:ZERO');
|
||||
} finally {
|
||||
Object.defineProperty(globalThis, 'fetch', { configurable: true, value: previousFetch });
|
||||
if (previousFetchDescriptor) {
|
||||
Object.defineProperty(globalThis, 'fetch', previousFetchDescriptor);
|
||||
} else {
|
||||
Reflect.deleteProperty(globalThis, 'fetch');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -98,11 +98,7 @@ export function buildCharacterDictionarySeriesKey(input: {
|
||||
}
|
||||
|
||||
export function createCharacterDictionaryManualSelectionStore(deps: { userDataPath: string }) {
|
||||
const filePath = path.join(
|
||||
deps.userDataPath,
|
||||
'character-dictionaries',
|
||||
'anilist-overrides.json',
|
||||
);
|
||||
const filePath = path.join(deps.userDataPath, 'character-dictionaries', 'anilist-overrides.json');
|
||||
|
||||
return {
|
||||
getOverride: async (seriesKey: string): Promise<CharacterDictionaryManualSelection | null> => {
|
||||
|
||||
Reference in New Issue
Block a user