mirror of
https://github.com/margrop/wrong-notebook.git
synced 2026-12-05 08:19:51 +08:00
fix: 修复测试文件中的 TypeScript 类型检查错误
This commit is contained in:
@@ -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 },
|
||||
}));
|
||||
|
||||
|
||||
@@ -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' }));
|
||||
|
||||
@@ -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 },
|
||||
|
||||
Reference in New Issue
Block a user