Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into 指定されているVVPPがなかったら確認…
Browse files Browse the repository at this point in the history
…後にインストールし、使えるようにするようにする
  • Loading branch information
Hiroshiba committed Oct 30, 2024
2 parents c9d4edf + e1304cc commit e179306
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/backend/electron/engineAndVvppController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
} from "@/type/preload";
import {
EnginePackage,
fetchDefaultEngineUpdateInfo,
fetchDefaultEngineInfos,
getSuitablePackages,
} from "@/domain/defaultEngine/latetDefaultEngine";
import {
Expand Down Expand Up @@ -157,7 +157,7 @@ export class EngineAndVvppController {
const latestUrl = envEngineInfo.latestUrl;
if (latestUrl == undefined) throw new Error("latestUrl is undefined");

const updateInfo = await fetchDefaultEngineUpdateInfo(latestUrl);
const updateInfo = await fetchDefaultEngineInfos(latestUrl);
if (updateInfo.formatVersion != 1) {
log.error(`Unsupported format version: ${updateInfo.formatVersion}`);
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/domain/defaultEngine/latetDefaultEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const defaultEngineUpdateInfoSchema = z.object({
});

/** デフォルトエンジンの更新情報を取得する */
export const fetchDefaultEngineUpdateInfo = async (url: string) => {
export const fetchDefaultEngineInfos = async (url: string) => {
const response = await fetch(url);
return defaultEngineUpdateInfoSchema.parse(await response.json());
};
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/domain/defaultEngine/defaultEngine.node.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import path from "path";
import fs from "fs";
import { fetchDefaultEngineUpdateInfo } from "@/domain/defaultEngine/latetDefaultEngine";
import { fetchDefaultEngineInfos } from "@/domain/defaultEngine/latetDefaultEngine";

const currentDir = "tests/unit/domain/defaultEngine";

Expand All @@ -14,7 +14,7 @@ test("fetchDefaultEngineInfo", async () => {
const spy = vi.spyOn(global, "fetch").mockResolvedValue(new Response(json));

// 読み込めることを確認
const infos = await fetchDefaultEngineUpdateInfo("https://example.com/");
const infos = await fetchDefaultEngineInfos("https://example.com/");
expect(infos.formatVersion).toBe(1);

spy.mockRestore();
Expand Down

0 comments on commit e179306

Please sign in to comment.