fix: 设置测试补 aiConfig 期望;打包配置 asarUnpack 原生模块与飞桨模型
This commit is contained in:
parent
3b0883c80f
commit
0e65fd751d
@ -25,6 +25,11 @@ export default {
|
||||
{ from: path.join(root, "resources", "fixture"), to: "fixture" }
|
||||
],
|
||||
asar: true,
|
||||
asarUnpack: [
|
||||
"node_modules/onnxruntime-node/**",
|
||||
"node_modules/sharp/**",
|
||||
"node_modules/@gutenye/**"
|
||||
],
|
||||
compression: "maximum",
|
||||
npmRebuild: false,
|
||||
electronVersion: packageJson.devDependencies.electron,
|
||||
|
||||
@ -22,14 +22,14 @@ describe("app settings", () => {
|
||||
});
|
||||
|
||||
it("returns the default element wait when no settings file exists", () => {
|
||||
expect(loadSettings()).toEqual({ browserElementWaitMs: 5000 });
|
||||
expect(loadSettings()).toEqual({ browserElementWaitMs: 5000, aiConfig: { baseUrl: "", apiKey: "", model: "" } });
|
||||
});
|
||||
|
||||
it("persists and clamps a user-adjustable element wait", async () => {
|
||||
const saved = updateSettings({ browserElementWaitMs: 12500 });
|
||||
expect(saved).toEqual({ browserElementWaitMs: 12500 });
|
||||
expect(saved).toEqual({ browserElementWaitMs: 12500, aiConfig: { baseUrl: "", apiKey: "", model: "" } });
|
||||
expect(JSON.parse(await readFile(path.join(electronState.userData, "settings.json"), "utf8"))).toEqual(saved);
|
||||
expect(updateSettings({ browserElementWaitMs: -5 })).toEqual({ browserElementWaitMs: 0 });
|
||||
expect(loadSettings()).toEqual({ browserElementWaitMs: 0 });
|
||||
expect(updateSettings({ browserElementWaitMs: -5 })).toEqual({ browserElementWaitMs: 0, aiConfig: { baseUrl: "", apiKey: "", model: "" } });
|
||||
expect(loadSettings()).toEqual({ browserElementWaitMs: 0, aiConfig: { baseUrl: "", apiKey: "", model: "" } });
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user