fix: 修复测试文件中的 TypeScript 类型检查错误

This commit is contained in:
margrop
2026-12-04 06:05:51 +08:00
parent a152bf32c4
commit d0f9535030
3 changed files with 3 additions and 3 deletions

View File

@@ -1344,7 +1344,7 @@ describe('备份导入体积与格式防护', () => {
const importRaw = (body: Uint8Array, contentType = 'application/json') =>
IMPORT(new Request('http://localhost/api/import', {
method: 'POST',
body,
body: body as BodyInit,
headers: { 'Content-Type': contentType },
}));

View File

@@ -105,7 +105,7 @@ describe('docker-entrypoint 版本检测', () => {
return line;
};
function currentVersion(env: Record<string, string>): string {
function currentVersion(env: Record<string, string | undefined>): string {
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'wn-version-'));
tempDirs.push(dir);
fs.writeFileSync(path.join(dir, 'package.json'), JSON.stringify({ version: '0.0.0' }));

View File

@@ -70,7 +70,7 @@ function listenHttp(handler: http.RequestListener): Promise<number> {
return promise;
}
function startProxy(env: NodeJS.ProcessEnv): Promise<number> {
function startProxy(env: Record<string, string | undefined>): Promise<number> {
const { promise, resolve, reject } = Promise.withResolvers<number>();
const child = spawn(process.execPath, [script], {
env: { ...process.env, CERT_DIR: certDir, ...env },